Here you can find the source of copyFileUsingChannel(File source, File dest)
public static void copyFileUsingChannel(File source, File dest) throws IOException
//package com.java2s; //License from project: Creative Commons License import java.io.*; import java.nio.channels.FileChannel; public class Main { public static void copyFileUsingChannel(File source, File dest) throws IOException { FileInputStream sourceStream = new FileInputStream(source); FileChannel sourceChannel = sourceStream.getChannel(); FileOutputStream outputStream = new FileOutputStream(dest); outputStream.getChannel().transferFrom(sourceChannel, 0, sourceChannel.size()); }/* w ww. j a v a 2 s . c o m*/ }