package TestIO;
import java.io.*;
public class Test01 {
public static void main(String[] args) throws Exception {
//创建输入流
FileInputStream fis = new FileInputStream("C:/Users/张东林/Desktop/(张东林)IOTCOMM-Help.chm");
FileOutputStream fos = new FileOutputStream("D:/(张东林)IOTCOMM-Help.chm");
//一边读一边写
byte[] bytes = new byte[1024];
int temp = 0;
while( (temp = fis.read(bytes)) != -1 ){
fos.write(bytes, 0, temp);
}
//刷新
fos.flush();
//关闭
fis.close();
fos.close();
}
}
188_使用FileInput_OutputStream完成复制
最新推荐文章于 2021-11-29 23:08:30 发布