import java.io.*;

public class BinFileCopy {
   public static void main(String[] argv) throws IOException {
	//
	// Create an object for both files
	//

       
	FileInputStream inputFile = new FileInputStream(argv[0]);
	FileOutputStream outputFile = new FileOutputStream(argv[1]);

        DataInputStream dis = new DataInputStream(inputFile);
        DataOutputStream dos = new DataOutputStream(outputFile);

 
	//
	// Assoicate a file reader with the "inputFile" and
	// a file writer with the "outputFile"
	//

	//
	// While not the end of the input file, read a character
	// and write it to the outputfile
	//

	int c;
	while((c = dis.read()) != -1)
	    dos.write(c);

	//
	// Close the input and the output files.
	//

	dis.close();
	dos.close();
    }
}
