Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;

public class Main {
    public static void main(String[] argv) throws Exception {
        FileChannel srcChannel = new FileInputStream("srcFilename").getChannel();
        FileChannel dstChannel = new FileOutputStream("dstFilename").getChannel();

        dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
        srcChannel.close();
        dstChannel.close();
    }
}