Java读取与写入图片文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cheng9981/article/details/52824944
//        FileImageInputStream fis = new  FileImageInputStream(new File("timg.jpg"));
//        FileImageOutputStream fos = new FileImageOutputStream(new File("timg1.jpg"));
        FileInputStream fis = new FileInputStream(new File("timg.jpg"));
        FileOutputStream fos = new FileOutputStream(new File("timg2.jpg"));

        byte[] read = new byte[1024];
        int len = 0;
        while((len = fis.read(read))!= -1){
            fos.write(read,0,len);
        }
        fis.close();
        fos.flush();
        fos.close();

展开阅读全文

没有更多推荐了,返回首页