Monday, October 27, 2014

Guava Files class

Sometimes you are still in the Java 1.6 land and you just to want to read the entire file into a list. Guava can help you:
File file = new File("trades_3.txt");
List<String> lines = Files.readLines(file, Charset.defaultCharset());
The Files class doc.

No comments: