Skip to content

Instantly share code, notes, and snippets.

@Kozlov-V
Last active December 20, 2015 13:19
Show Gist options
  • Save Kozlov-V/6138183 to your computer and use it in GitHub Desktop.
Save Kozlov-V/6138183 to your computer and use it in GitHub Desktop.
file to inputstream
File file = ...
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment