一、方式一
public static void demo1() throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream("res.jpg"); //创建输入流对象,关联res.jpg
FileOutputStream fos = new FileOutputStream("copy.jpg"); //创建输出流对象,关联copy.jpg
int b;
while((b = fis.read()) != -1) { //在不断的读取每一个字节
fos.write(b); //将每一个字节写出
}
fis.close(); //关流释放资源
fos.close();
}
public static void demo1() throws FileN