Skip to content

Instantly share code, notes, and snippets.

@LenarBad
Created December 8, 2017 18:19
Show Gist options
  • Select an option

  • Save LenarBad/984b5f840a1e2be26ec34a8d967434e7 to your computer and use it in GitHub Desktop.

Select an option

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

LenarBad commented Dec 8, 2017

Copy link
Copy Markdown
Author

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