字节流复制文件

package it_04;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis =new FileInputStream("D:\\game\\java.txt");
        FileOutputStream fos =new FileOutputStream("fos.txt");
        int read;
        while((read= fis.read())!=-1){
            fos.write(read);
        }
        fis.close();
        fos.close();
    }
}
posted @ 2025-04-22 16:17  lfqyj  阅读(5)  评论(0)    收藏  举报