Skip to content

Instantly share code, notes, and snippets.

@LenarBad
Created December 8, 2017 18:19
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 LenarBad/984b5f840a1e2be26ec34a8d967434e7 to your computer and use it in GitHub Desktop.
Save LenarBad/984b5f840a1e2be26ec34a8d967434e7 to your computer and use it in GitHub Desktop.
How to read file into List of Strings with Google Guava
public List<String> getFileAsListOfStringsGuava(String fileName) throws IOException {
InputStream input = this.getClass().getResourceAsStream("/" + fileName);
return CharStreams.readLines(new InputStreamReader(input, StandardCharsets.UTF_8));
}
@LenarBad
Copy link
Author

LenarBad commented Dec 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment