public static void testIOChar() throws IOException { Reader reader = new FileReader("C:\\test.txt"); Writer writer = new FileWriter("E:\\test.txt"); int x; while ((x = reader.read()) != -1) { writer.write(x); } reader.close(); writer.close(); System.out.println("文件复制成功!"); }