/*高效流:BufferedReader
BufferedWriter
*/
public class Demo_3(){
public static void main(String[] args){
//创建对象
Reader in = new Reader("a.txt");
BufferedReader br = new BufferedReader(in);
Writer out = new Writer("b.txt");
BufferedWriter bw = new BufferedWriter(out);
//定义字符串
String s = "";
while((s=br.readLine())!=null){
bw.write(s);
}
br.close();
bw.close();
}
}
|
|