CS2 Week 3
Copy File Program - bytes
nimport java.io.*;
npublic class CopyBytes {
npublic static void main(String[]args)
n       throws IOException {
n File inputFile = new File(“one.tst");
n File outputFile = new File(“two.tst“);
n FileInputStream in = new FileInputStream(inputFile);
n FileOutputStream out = new FileOutputStream(outputFile);
n int byt;
n while ((byt = in.read()) != -1) {out.write(byt);    }
n in.close();
n out.close();
n }
n }
n