package Zy;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;public class Zy02 { //用字符流完成txt的复制 public static void main(String[] args) throws IOException { FileReader r=new FileReader("d:\\java\\789.txt"); FileWriter w=new FileWriter("e:\\java\\789.txt"); char[] ch=new char[1024]; int len=0; while((len=r.read(ch))!=-1){ w.write(ch,0,len); w.flush(); } r.close(); w.close(); }}