字节流简单文件复制
@Test
public void FileInput() throws IOException {
File file = new File("a.txt"); //源,可用路径地址代替 文件格式任意
FileInputStream fileInputStream = new FileInputStream(file);
FileOutputStream fileOutputStream = new FileOutputStream("b.txt"); //复制后文件保存地址,默认在工程目录下
byte[] bytes= new byte[1024]; //缓冲容器
int len;
while ((len = fileInputStream.read(bytes))!=-1){
fileOutputStream.write(bytes,0,len);
}
fileInputStream.close();
fileOutputStream.close();
}