public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
String pathWriter = "d:" + File.separator + "javatest" + File.separator + "1.txt";
String pathReader = "d:" + File.separator + "javatest" + File.separator + "CollectionTest1.java";
FileReader fr = new FileReader(new File(pathReader));
FileWriter fw = new FileWriter(new File(pathWriter), true);
char[] bufChar = new char[1024];
int result = 0;
while((result = fr.read(bufChar)) != -1) {
fw.write(bufChar);
System.out.println(new String(bufChar, 0, result));
}
fr.close();
fw.close();
}
}