Simple copy form

{class Seventh02 public 
public static void main (String [] args) throws IOException {
// Create a data source in accordance with the input byte stream objects
the FileInputStream new new FIS = the FileInputStream ( "D: \\ \\ psb.jpg Heima");
// The destination byte stream created output object
fos = new FileOutputStream FileOutputStream ( "F : \\ luoli2.jpg");
a byte array // read and write data, the copy image (first reading a byte array, the write-once )
byte [] bytes = new new byte [1024]; // create a qualified byte array 1024
int len; // length in bytes of the picture
the while ((len = fis.read (bytes)) = -1) {!
fos .write (bytes, 0, len);
}
// release resources
fos.close ();
fis.close ();

}
}

Guess you like

Origin www.cnblogs.com/YRSWBY2016/p/12019133.html