// 将一个文本文件复制,每次读取一个字符 public static void method_02() throws IOException { FileWriter fw = new FileWriter("LearnTest_copy.txt"); FileReader fr = new FileReader("LearnTest.java"); int num = 0; while ((num = fr.read()) != -1) { fw.write(num); } fw.close(); fr.close(); }