Byte stream file copy InputStream OutputStream

From , 3 Years ago, written in Java, viewed 214 times.
URL https://pastebin.vip/view/e555ebe0
  1.         public static void testIOStream() throws IOException {
  2.                 InputStream inputStream = new FileInputStream("C:\\test.txt");
  3.                 OutputStream outputStream = new FileOutputStream("E:\\test.txt");
  4.                 int x;
  5.                 while ((x = inputStream.read()) != -1) {
  6.                         outputStream.write(x);
  7.                 }
  8.                 inputStream.close();
  9.                 outputStream.close();
  10.                 System.out.println("文件复制成功!");
  11.         }

Reply to "Byte stream file copy InputStream OutputStream"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website