利用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();
}
}