package com.io.liushuaishuai;
import java.io.*;
public class copyjavaDemo {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(new FileInputStream("C:\Users\86132\IdeaProjects\javaSE_Code\myIOstream\src\com\io\liushuaishuai\BufferStreamDemo.java"));
OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("C:\Users\86132\IdeaProjects\javaSE_Code\myIOstream\src\com\io\liushuaishuai\copy.java"));
//一次读取一个字符数据
/*
int i;
while((i= isr.read())!= -1) {
osw.write(i);
}
osw.close();
isr.close();
*/
//一次读取一个字符数组
char[] a = new char[1024];
int len;
while ((len = isr.read(a)) != -1) {
osw.write(a,0,len);
}
osw.close();
isr.close();
}
}