Copy.java Source code

Java tutorial

Introduction

Here is the source code for Copy.java

Source

import java.io.FileInputStream;
import java.io.FileOutputStream;

class Copy {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = null;
        FileOutputStream fos = null;
        fis = new FileInputStream(args[0]);
        fos = new FileOutputStream(args[1]);

        int byte_;
        while ((byte_ = fis.read()) != -1)
            fos.write(byte_);
    }
}