package it.BufferdreaderDemo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Demo01 {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new FileReader("TuZiDemo.java"));
BufferedWriter bw=new BufferedWriter(new FileWriter("d:\\a.txt"));
char[] chs=new char[1024];
int len=0;
while((len=br.read(chs))!=-1){
bw.write(chs,0,len);
}
br.close();
bw.close();
}
}
|
|