FileInputStream fis =
new FileInputStream("JAVA_SE.rar");
FileOutputStream fos =
new FileOutputStream("JAVA_SE_COPY.rar");
long start = System.currentTimeMillis();
int len = -1;
byte[] buffer = new byte[512];
while((len=fis.read(buffer)) != -1){
fos.write(buffer,0,len);
}
fis.close();
fos.close();
long end = System.currentTimeMillis();
System.out.println((end-start) +"毫秒");
使用输入输出流实现文件复制
最新推荐文章于 2021-11-29 20:07:21 发布