package com.itcast.demo05.Buffered;

import java.io.*;

/**
* @author newcityman
* @date 2019/7/28 - 17:05
*/
public class BufferedCopy {
public static void main(String[] args) throws IOException {
long s = System.currentTimeMillis();
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("H:\\IMG_7621.JPG"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("e:\\IMG_7621.JPG"));

int len=0;
byte[] bytes = new byte[2048];
while((len=bis.read(bytes))!=-1){
bos.write(bytes,0,len);
}

bos.close();
bis.close();
long e = System.currentTimeMillis();
System.out.println("拷贝文件总共耗时:"+(e-s)+"毫秒");
}

}

最新文章

  1. CentOS 7 Git安装
  2. zepto区别于jquery获取select表单选中的值
  3. RedHat/Centos修改root密码
  4. Bootstrap相关总结
  5. [转] 主流JS框架中DOMReady事件的实现
  6. Android项目实战(二十):浅谈ListView悬浮头部展现效果
  7. Eclipse在线安装ADT插件
  8. changing a pointer rather than erasing memory cells
  9. Ruby相关图书推荐
  10. Read Asia Embedded fell
  11. MVC5 学习资料
  12. NGUI字体贴图压缩以及相关Shader解读
  13. 【屌丝程序的口才逆袭演讲稿50篇】第十篇:程序猿们请看看外面的世界吧【张振华.Jack】
  14. Caffe学习系列(一)Ubuntu16.04下搭建编译Caffe环境,并运行MNIST示例(仅CPU)
  15. 20170713_js闭包/匿名函数/作用域
  16. Spring JDBC(二)SimpleJdbcInsert
  17. 制作windows系统合盘:把win7和win8/8.1打包在一起
  18. SpringBoot文件上传(MVC情况和webFlux情况)
  19. Perl构建和打包自己的模块
  20. Nginx IP地址透传

热门文章

  1. RDD的缓存
  2. IDEA常用优化设置
  3. 浅谈web前端优化
  4. [tc14634]ExtremeSpanningTrees
  5. [atARC110F]Esoswap
  6. [bzoj1188]分裂游戏
  7. 【HTML】基础
  8. Java 代码审计 — 1. ClassLoader
  9. myeclipse激活、破解教程
  10. 17 款程序员必备 Chrome扩展插件,爱了爱了!