Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to read file into String with Google Guava
public String getFileIntoStringGuava(String fileName) throws IOException {
InputStream input = this.getClass().getResourceAsStream("/" + fileName);
return CharStreams.toString(new InputStreamReader(input, StandardCharsets.UTF_8));
}
@LenarBad

This comment has been minimized.

Copy link
Owner Author

LenarBad commented Dec 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.