1// Java 7
2 BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
3
4 // Java 8
5 List<String> list = Files.readAllLines(path, StandardCharsets.UTF_8);
6
7 // Java 8
8 Stream<String> lines = Files.lines(path, StandardCharsets.UTF_8);
9
10 // Java 11
11 String s = Files.readString(path, StandardCharsets.UTF_8);