标签:stack NPU while close new 文件 cat static int
import java.io.*; public class TestFileOutputStream{ public static void main(String[] args){ try{ FileOutputStream out = new FileOutputStream("D:/Java/TestFileOutputStream/copy.txt"); FileInputStream in = new FileInputStream("D:/Java/TestFileOutputStream/TestFileOutputStream.java"); int b = 0; while((b = in.read()) != -1){ out.write(b); } out.flush(); out.close(); in.close(); } catch(FileNotFoundException e){ e.printStackTrace(); } catch(IOException e){ e.printStackTrace(); } } }
利用FileOutputStream类和FileInputStream类拷贝一个文件
标签:stack NPU while close new 文件 cat static int
原文地址:https://www.cnblogs.com/yxfyg/p/12394663.html