package cn.itast.chap.sttt01.IO_FileIoputStream输入流和FileOutputStream输出流;
/*
文件复制
*/
import java.io.*;
public class FileReader_FileWriter_复制与粘贴
{
public static void main(String[] args) throws Exception
{
FileReader fr = new FileReader("Copy02.java");
FileWriter fw = new FileWriter("C:\\GameDownload\\Copy02.java");
//复制粘贴
char[] chars = new char[512] ;
int temp = 0;
while((temp = fr.read(chars)) != -1){
//写
fw.write(chars,0 ,temp);
}
//刷新
fw.flush();
//关闭
fr.close();
fw.close();
}
}
FileReader_FileWriter_复制与粘贴
最新推荐文章于 2022-07-18 19:34:53 发布