// Character stream file I/O example
// Uses FileReader to read characters from a file
// and FileWriter to write characters to a file
import java.io.*;
public class CharStreamExample {
public static void main(String[] args) {
try {
FileReader fr = new FileReader("input.txt");
FileWriter fw = new FileWriter("output.txt");
int ch;
while((ch = fr.read()) != -1) {
fw.write(ch);
}
fr.close();
fw.close();
} catch(IOException e) {
e.printStackTrace();
}
}
}
