public class CopyJavaDome01 {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(new FileInputStream(“D:\IDEA\src\JavaHeiMa02\src\字符流CharStream\字符流输入流读数据\InputStreamReaderDome01.java”));
OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(“D:\IDEA\src\JavaHeiMa02\src\字符流CharStream\字符流复制文件\Copy.txt”));
//一次读写一个字符数据
// int ch;
// while ((ch=isr.read())!=-1){
// osw.write(ch);
// }
//一次读写一个数组
char[] chs = new char[1024];
int len;
while ((len=isr.read(chs))!=-1){
osw.write(chs,0,len);
}
isr.close();
osw.close();
}
}