public class Demo4_Buffered(){
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader (new FileRead("xxx.txt"));
String line;
while((line = br.readLine()) != null){ //整行读取
syso(line);
}
br.close();
}
}
public class Demo5_Buffered(){
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader (new FileRead("xxx.txt"));
BufferedWriter bw = new BufferedWriter (new FileWriter("aaa.txt"));
String line;
while((line = br.readLine()) != null){ //整行读取
bw.writer(line);
bw.newLine(); //写出回车换行符 和bw.write(" ");一个效果,但是newLine()是支持各种操作平台的
}
br.close();
bw.close();
}
}