blob: 879966151e4922b2613a6c9358f7c38d8a60f692 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package se.leap.bitmaskclient.utils;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
/**
* Created by cyberta on 18.03.18.
*/
public class InputStreamHelper {
//allows us to mock FileInputStream
public static InputStream getInputStreamFrom(String filePath) throws FileNotFoundException {
return new FileInputStream(filePath);
}
public static String loadInputStreamAsString(InputStream is) {
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
}
|