package www.tainiu.wenjian; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class ad__FileImage { public static void main(String[] args) { // TODO Auto-generated method stub FileInputStream fis= null; FileOutputStream fos= null; try { fis= new FileInputStream("d:\\jscb.png"); fos= new FileOutputStream("e:\\jscb.png"); byte[] bytes= new byte[1024]; int n= 0; while((n=fis.read(bytes)) != -1) { fos.write(bytes); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try {fis.close();fos.close();} catch (Exception e) {e.printStackTrace();} } } }
原文:http://www.cnblogs.com/wujianbo123/p/7633132.html