Java读取与写入图片文件

来源:互联网 发布:视频音乐提取软件 编辑:程序博客网 时间:2024/06/10 03:28
//        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();

0 0
原创粉丝点击