第四篇学习笔记
2016-04-08 20:50
417 查看
import java.io.*; public class CopyFile { /** * @param args */ public static void copy(File a,File b){ try { FileInputStream fis = new FileInputStream("a.mp3"); FileOutputStream fos = new FileOutputStream("temp.mp3"); byte[] buf = new byte[330217]; int length; int read = fis.read(); while((length = fis.read(buf))!=-1){ fos.write(buf, 0, length); // } fis.close(); fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) { // TODO Auto-generated method stub File a = new File(""); File b = new File(""); long start,end; start = System.currentTimeMillis(); copy(a,b); end = System.currentTimeMillis(); System.out.println("用时:" + (end - start) + "ms"); // } }
相关文章推荐
- Nagios
- Javascript编程笔记(一)
- 高盛VR/AR报告完整解读版
- FPGA零散笔记
- 封装分页查询的类
- 05章 体检套餐管理系统
- 设置时区TimeZone
- Useful Links for Deep Learning
- py-faster-rcnn配置运行faster_rcnn_end2end—VGG_CNN_M_1024(Ubuntu14.04)
- android 开发环境搭建
- An internal error occurred during: "Initializing Java Tooling". java.lang.NullPointerException
- 正确的事情要坚持做下去(一):说再见
- java连接Redis
- 关于内联框架
- 栈的使用
- Log类简单的使用
- Mercurial使用笔记(3)
- 使用hexo在github上搭建博客
- 【学习笔记】3D图形核心基础精炼版-7:stage3D实战-范例工程1
- 算法训练 最大的算式(动态规划)