Skip to content

Instantly share code, notes, and snippets.

@mikeseif
Created July 30, 2014 15:51
Show Gist options
  • Save mikeseif/c2575e12b7c876f431ea to your computer and use it in GitHub Desktop.
Save mikeseif/c2575e12b7c876f431ea to your computer and use it in GitHub Desktop.
Logging a FileStream
private void logFileStream(FileInputStream fis) {
BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ( (line = reader.readLine()) != null) {
sb.append(line);
}
Log.d("FILESTREAM", sb.toString());
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment