public static void main(String[] args)throws IOException {
String srcFile="D:\\imooc\\1.jpg";
String destFile="D:\\imooc\\2.jpg";
String destFile2="D:\\imooc\\3.jpg";
long start =System.currentTimeMillis();
IOUtil.CopyFileByBuffer(new File(srcFile), new File(destFile));
long end =System.currentTimeMillis();
System.out.println(end-start);
long start2 =System.currentTimeMillis();
IOUtil.copyFile(new File(srcFile), new File(destFile2));
long end2 =System.currentTimeMillis();
System.out.println(end2-start2);
}
缓冲区设置都是1024 为啥用byByte只用50ms 而Buffered要用10318ms