字符缓冲流特有功能复制Java文件
package com.czie.iot1913.lps.IO.BufferStream;
import java.io.*;
/**
* FileName: BufferedCopyDemo
* Author: lps
* Date: 2022/3/26 16:50
* Sign:刘品水 Q:1944900433
*/
public class BufferedCopyDemo {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("F:\\JavaCode\\ConversionStreamDemo.java"));
BufferedWriter bw = new BufferedWriter(new FileWriter("F:\\JavaCode\\Copy.java"));
String line;
while ((line= br.readLine())!=null){
bw.write(line);
bw.newLine();
bw.flush();
}
br.close();
bw.close();
}
}