java输入输出流处理图片怎么提取相片

public class BinaryOperation {
 public static void main(String args[]){
  FileInputStream fis = null;
  FileOutputStream fos = null;
  try {

   fis = new FileInputStream("d:/图片/chenhl.jpg");
   byte[] b = new byte[128];

   fos = new FileOutputStream("d:/图片/chenhl 复件.jpg");
   while(fis.read(b)!=-1){
    fos.write(b);
   }

  } catch (Exception e) {
   e.printStackTrace();
  }finally{
   try{
    if(fis!=null) fis.close();
    if(fos!=null) fos.close();
   }catch(Exception e){
    e.printStackTrace();
   }
  }
 }
}

你可能感兴趣的:(java,图片)