// file stream demo - both read and write streams of characters
import java.io.*;

class FileCopy {


	public static void main (String args[]) {

		File infile, outfile;
		FileReader frs;	// file read stream
		FileWriter fws; // file write stream

		try {
			infile = new File (args[0]);
			outfile = new File (args[1]);

			frs = new FileReader (infile);
			fws = new FileWriter (outfile);

			int ch;
			while ( (ch=frs.read()) != -1) {

				fws.write(ch);
			}
			frs.close();
			fws.close();
		} catch (Exception e) {System.out.println("An exception");}

	}
}



