List of utility methods to do File to InputStream
InputStream | openInputStream(String path) Opens an inputStream to the specified file.
try { return new FileInputStream(path); } catch (IOException e) { return null; |
InputStream | openStream(final Class clazz, final String path) open Stream return clazz.getResourceAsStream(path);
|
InputStream | openStream(final File file) Opens the given File to read it. InputStream is = new FileInputStream(file); if (isGZIPFile(file.getName())) { return new GZIPInputStream(is); return is; |
BufferedReader | openStream(InputStream in) open Stream return new BufferedReader(new InputStreamReader(in, "UTF-8")); |