IO流入门-第九章-BufferedReader_BufferedWriter复制

利用BufferedReader和BufferedWriter进行复制粘贴

import java.io.*;

public class BufferedReader_BufferedWriterCopy
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new FileReader("BufferedReader_BufferedWriterCopy.java")); BufferedWriter bw = new BufferedWriter(new FileWriter("D:/BufferedReader_BufferedWriterCopy.java")); String temp = null;
while((temp = br.readLine()) != null){
bw.write(temp);
bw.newLine();
} bw.flush(); br.close();
bw.close();
}
}
上一篇:go-并发


下一篇:使用Guava RateLimiter限流入门到深入