现在读取文件内容一次性读取很方便。
public static void main(String[] args) {
try {byte[] bytes = Files.readAllBytes(Paths.get("D:/迅雷下载/license.txt"));
String content = new String(bytes, StandardCharsets.UTF_8.toString());
System.out.println(content);
} catch (IOException e1) {
e1.printStackTrace();
}
}