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(); } }
javaee字符文件的复制
猜你喜欢
转载自www.cnblogs.com/hankai2735/p/9224792.html
今日推荐
周排行