Created
December 8, 2017 18:19
-
-
Save LenarBad/984b5f840a1e2be26ec34a8d967434e7 to your computer and use it in GitHub Desktop.
How to read file into List of Strings with Google Guava
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<String> getFileAsListOfStringsGuava(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return CharStreams.readLines(new InputStreamReader(input, StandardCharsets.UTF_8)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to read file into list of Strings