Java Utililty Methods File to InputStream

List of utility methods to do File to InputStream

Description

The list of methods to do File to InputStream are organized into topic(s).

Method

InputStreamopenInputStream(String path)
Opens an inputStream to the specified file.
try {
    return new FileInputStream(path);
} catch (IOException e) {
    return null;
InputStreamopenStream(final Class clazz, final String path)
open Stream
return clazz.getResourceAsStream(path);
InputStreamopenStream(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;
BufferedReaderopenStream(InputStream in)
open Stream
return new BufferedReader(new InputStreamReader(in, "UTF-8"));