IO 输入输出 Byte

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

public class CopyFileDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\windows.iso");
        FileOutputStream fos = new FileOutputStream("D:\\win10.iso");
        byte[] bytes = new byte[2048];
        int len = 0;
        while ((len = fis.read(bytes)) != -1) {
            fos.write(bytes, 0, len);
        }
        fos.close();
        fis.close();
    }
}
IO

 

posted @ 2020-09-25 15:11  享受折腾  阅读(127)  评论(0)    收藏  举报