package com.test.tes;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.Date; /**
* 复制文件到指定目录下
* @author Wdnncey
*
*/ public class Copy { public static long forJava(File f1,File f2) throws Exception{
long time=new Date().getTime();
int length=2097152;
FileInputStream in=new FileInputStream(f1);
FileOutputStream out=new FileOutputStream(f2);
byte[] buffer=new byte[length];
while(true){
int ins=in.read(buffer);
if(ins==-1){
in.close();
out.flush();
out.close();
return new Date().getTime()-time;
}else
out.write(buffer,0,ins);
}
} public static void main(String[] args) {
try {
forJava(new File("1.zip"), new File("e:\\a\\b\\2.zip"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }

最新文章

  1. 让div固定在顶部不随滚动条滚动
  2. delphi 10 seattle 安卓服务开发(三)
  3. iOS:iOS开发非常全的三方库、插件等等
  4. Android——ScrollView
  5. POJ1948Triangular Pastures(DP)
  6. IOS UITableView Group&Section
  7. XML操作:2.LINQ TO XML(http://www.cnblogs.com/AlexLiu/archive/2008/10/27/linq.html)
  8. 【转】移动互联网应用测试成长技能树V1.0
  9. iOS 9 适配需要注意的问题
  10. mysql 基础技术
  11. [黑马程序员] 集合框架2——Map系 & 集合工具类(Collections、Arrays)
  12. asp.net 输出Excel
  13. JavaScript小括号、中括号、大括号的多义性
  14. kaldi chain模型的序列鉴别性训练代码分析
  15. SharePoint Framework 基于团队的开发(二)
  16. Linux企业运维人员最常用150个命令汇总 [转]
  17. Linux - iptable 限制 IP 访问端口
  18. chromium ⑤
  19. es6学习笔记8--Map数据结构
  20. qualcomm permission denied for tty device

热门文章

  1. Java代码块
  2. JavaWeb学习笔记——Tomcat配置
  3. 其他系统与ecshop的会员整合
  4. Realm简单使用小记
  5. AspNet Identity and IoC Container Registration
  6. centos 7.0 修改ssh默认连接22端口 和 添加防火墙firewalld 通过端口
  7. Python之路【第十篇】Python操作Memcache、Redis、RabbitMQ、SQLAlchemy、
  8. Web启动服务器上的某一个服务
  9. python内置函数每个执行一次
  10. 深入理解Java:注解(Annotation)--注解处理器