Java复制图片

public class Demo04 {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\雪芹\\Pictures\\Screenshots\\屏幕截图(1).png");
        FileOutputStream fileOutputStream = new FileOutputStream("屏幕截图(1).png");
        byte[]bytes=new byte[1024];
        int by;
        while ((by=fileInputStream.read(bytes))!=-1){
            fileOutputStream.write(bytes,0,by);
        }
        fileOutputStream.close();
        fileInputStream.close();
    }

}
上一篇:实验5


下一篇:sql 语句中使用条件判断case then else end