IO流自定义字符数组的拷贝。

public static void main(String[] args) throws IOException{

  FileRead fr = new FileRead ("xxx.txt");

  FileWrite fw = new FileWrite ("yyy.txt");

  char [] arr = new char[1024*8];

  int len;

  while((len = fr.read(arr)) != -1){  //将文件上的数据读取到字符数组中

    fw.write(arr,0,len);   //将字符数组中的数据写到文件上(从0开始读取,读取长度为len)

  }

  fr.close();

  fw.close();

}

原文地址:https://www.cnblogs.com/wangffeng293/p/13179206.html