IO編程__字節流__輸入、輸出__圖片移動
阿新 • • 發佈:2017-10-07
() gen rgs io編程 image generated finally dex highlight
一、代碼如下
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();} } } }
IO編程__字節流__輸入、輸出__圖片移動