BufferedReader bfr = new BufferedReader(
new InputStreamReader(
new BufferedInputStream(
new FileInputStream("test.txt")
),"UTF-8")
);
String line = bfr.readLine();
System.out.println(line);
line = bfr.readLine();
System.out.println(line); // null,文件结尾
bfr.close();
字符流定义字符集
最新推荐文章于 2023-03-01 10:08:59 发布