// 缓冲流的读写操作
public void bufferedReaderAndWriter(){
// 创建缓冲流的读写对象
try {
BufferedReader br=new BufferedReader(new FileReader("h:/a.txt"));
BufferedWriter bw=new BufferedWriter(new FileWriter("h:/b.txt",true));
// 读写操作
String str= br.readLine();
while(str!=null){
// 写入数据
bw.write(str);
// 换行
bw.newLine();
str=br.readLine();
}
// 关闭流
bw.flush();
bw.close();
br.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}