import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.IOException;public class Test2 { public static void main(String[] args) throws IOException { // 召唤一个真正可读的对象 Fi
import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.IOException;public class Test2 { public static void main(String[] args) throws IOException { // 召唤一个真正可读的对象 FileReader fRead = new FileReader("缓冲写数据.txt"); // 实例化字符缓冲输入流 BufferedReader bufferedReader = new BufferedReader(fRead); // 读数据(遍历读完所有) char[] chars = new char[5]; int len = bufferedReader.read(chars); while (len != -1) { // 输出数据 String msg = new String(chars, 0, len); System.out.print(msg); // 重新读一下 len = bufferedReader.read(chars); } // 关资源 bufferedReader.close(); fRead.close(); // 程序结束 System.out.println("game over"); }}