字节流复制大数据
2016-04-06 17:00
302 查看
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/*copy大文件*/
public class FilesCopyDemo {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
FileInputStream fis = new FileInputStream("d:\\a.avi");
FileOutputStream fos = new FileOutputStream("e:\\b.avi");
byte fileBytes[] = new byte[1024];
int len =0;
while((len = fis.read(fileBytes))!=-1){
fos.write(fileBytes, 0, len); //按1024个字节写数据
}
fos.close();
fis.close();
}
}
import java.io.FileOutputStream;
import java.io.IOException;
/*copy大文件*/
public class FilesCopyDemo {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
FileInputStream fis = new FileInputStream("d:\\a.avi");
FileOutputStream fos = new FileOutputStream("e:\\b.avi");
byte fileBytes[] = new byte[1024];
int len =0;
while((len = fis.read(fileBytes))!=-1){
fos.write(fileBytes, 0, len); //按1024个字节写数据
}
fos.close();
fis.close();
}
}
相关文章推荐
- 应用SuperIO(SIO)和开源跨平台物联网框架ServerSuperIO(SSIO)构建系统的整体方案
- http://blog.csdn.net/lmj623565791/article/details/39122981
- http://blog.csdn.net/lmj623565791/article/details/39121377
- RAID 磁盘状态为foreign,怎么变成ready
- dell r710 服务器配置RAID5(3块硬盘做RAID5,另外再弄一块做数据冗余盘)
- Apache问题解决:httpd: Could not reliably determine the server's fully qualified domain name
- 关于大数据量下Core Data的数据迁移
- 大数据下的Distinct Count(二):Bitmap篇
- canvas.drawText(string, xPos, yPos, paint)文本居中的办法
- Mac OS 安装tensorflow RuntimeError: Broken toolchain: cannot link a simple C program
- 1106. Lowest Price in Supply Chain (25) 树的遍历,DFS
- 解决"initialization failure:0×0000000c"和"txwebserver遇到未知错误"
- 51nod1305 Pairwise Sum and Divide
- AIDL 实现 IPC(进程间通信)
- Assertion failure layoutSublayersOfLayer:], /SourceCache
- dubbo服务无法注册问题 Failed to subscribe consumer:// 解决方法
- 随记(十)--'xxx' does not contain bitcode报错
- 公司100个用户桌面虚拟化该怎么做?
- 空荡的数据中心,120种妙用!
- LeetCode Container With Most Water