一个非常的简单的图片copy实例,虽然简单却很实用

package com.practice4;
import java.io.*;
public class TestCopy {
 public static void main(String[] args)throws IOException {
  FileInputStream fis=new FileInputStream("F:\\My  Pictures\\可爱小孩
\\2.gif");
  BufferedInputStream bis=new BufferedInputStream(fis);
  BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("reg\\child.jpg"));
  int len=0;
  while((len=bis.read())!=-1){
   bos.write(len);
  }
  bos.close();
 }

}

 

posted @ 2012-05-17 18:41  yangkai_keven  阅读(104)  评论(0编辑  收藏  举报