第四篇笔记
2016-04-15 19:06
246 查看
/**
@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[1024];
int len;
int read = fis.read();
while((len = fis.read(buf))!=-1){
fos.write(buf, 0, len);
}
fis.close();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
![](https://images2015.cnblogs.com/blog/903273/201604/903273-20160415190525332-688958807.png)
}
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");
}
@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[1024];
int len;
int read = fis.read();
while((len = fis.read(buf))!=-1){
fos.write(buf, 0, len);
}
fis.close();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
![](https://images2015.cnblogs.com/blog/903273/201604/903273-20160415190525332-688958807.png)
}
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");
}
![](https://images2015.cnblogs.com/blog/903273/201604/903273-20160415190458176-2065432759.png)
相关文章推荐
- MUI_Ajax
- POJ 3684 Physics Experiment
- SPOJ 7258 SUBLEX 后缀自动机
- JAVA 反射总结
- 电影节(SDUT_2797)
- 剑指offer(三)之二维数组中的查找
- requests的介绍和学习
- python资料全集
- 定义含有min函数的栈
- linux c/c++ 后台开发之—连接池
- 手把手教你玩Instrunments
- 算法与数据机构学习_第一章.栈和队列_1.设计一个有返回栈中最小元素功能的栈
- 反射四步走
- android学习之unbindservice一
- linux c/c++ 后台开发之—连接池
- 大数减法
- 数据结构 线性表中删除某一元素的程序
- coco游戏android.mk
- WebServices身份验证
- HDU 1878 欧拉回路 【基础并查集】