Skip to content

Instantly share code, notes, and snippets.

@funkyidol
Created October 3, 2013 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkyidol/6812333 to your computer and use it in GitHub Desktop.
Save funkyidol/6812333 to your computer and use it in GitHub Desktop.
Read small files from storage
BufferedReader br = new BufferedReader(new FileReader("file.txt"));
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
while (line != null) {
sb.append(line);
sb.append('\n');
line = br.readLine();
}
String everything = sb.toString();
} finally {
br.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment