package com.itheima.demo04;
import java.io.*;
/**
* @author Mr.liu
* 复制一个文件
*/
public class demo {
public static void main(String[] args) {
try (FileOutputStream fileOutputStream = new FileOutputStream("e:\\传智2.zip");
FileInputStream fileInputStream = new FileInputStream("e:\\开发环境\\传智.zip");
) {
byte[] bytes = new byte[1024];
int len = 0;
while ((len = fileInputStream.read(bytes)) != -1) {
fileOutputStream.write(bytes);
}
fileInputStream.close();
fileOutputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
03-25
4822
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交