If you need a string processing (parallel processing) Java 8 has the great Stream API.
String result = Files.lines(Paths.get("file.txt")) .parallel() // for parallel processing .map(String::trim) // to change line .filter(line -> line.length() > 2) // to filter some lines by a predicate .collect(Collectors.joining()); // to join lines
More examples are available in JDK samples sample/lambda/BulkDataOperations
that can be downloaded from Oracle Java SE 8 download page
Another one liner example
String out = String.join("\n", Files.readAllLines(Paths.get("file.txt")));