public static void main(String[] args) throws IOException {
// ① 对象实例化
File f1 = new File("io1.jpg");
File f2 = new File("io2.jpg");
// ②读写文件
InputStream fis = new FileInputStream(f1);
OutputStream fos = new FileOutputStream(f2);
byte[] b = new byte[1024];
int len;
while ((len = fis.read(b)) != -1) {
System.out.println(len);
fos.write(b);
}