今日天气:大雨落幽燕,白浪滔天(好水啊)
字节流复制文件
import java.io.*;
public class copyMP4{
public static void main(String[] args) throws IOException {
long start=System.currentTimeMillis();
// BufferedInputStream bis=new BufferedInputStream(new FileInputStream("F:\\videos\\1.mp4"));
// BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("F:\\videos\\1cp.mp4"));//59毫秒
FileInputStream fis=new FileInputStream("F:\\videos\\1.mp4");
FileOutputStream fos=new FileOutputStream("F:\\videos\\1cpcp.mp4");//349
byte[] bytes=new byte[1024];
int len;
while((len=fis.read(bytes))!=-1) fos.write(bytes,0,len);
fis.close();
fos.close();
long end=System.currentTimeMillis();
System.out.println(end-start);
}
}