java学习笔记--io流的异常处理
public static void main(String[] args) { // readTest(); copyImage(); } // 拷贝图片 public static void copyImage() { FileInputStream fileInputStream = null; FileOutputStream fileOutputStream = null; try { // 找到目标文件 File inFile = new File("F:\\美女\\1.jpg"); File outFile = new File("E:\\1.jpg"); // 建立输入输出通道 fileInputStream = new FileInputStream(inFile); fileOutputStream = new FileOutputStream(outFile); // 建立缓冲数组,边读边写 byte[] buf = new byte[1024]; int length = 0; while ((length = fileInputStream.read(buf)...