📜  java 文件阅读器 utf 8 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:45.788000             🧑  作者: Mango

代码示例1
// 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);