📅  最后修改于: 2022-03-11 14:52:45.788000             🧑  作者: Mango
// Java 7
BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
// Java 8
List list = Files.readAllLines(path, StandardCharsets.UTF_8);
// Java 8
Stream lines = Files.lines(path, StandardCharsets.UTF_8);
// Java 11
String s = Files.readString(path, StandardCharsets.UTF_8);