Here you can find the source of copyFile(File sourceFile, File destFile)
Faster copying method from http://www.javalobby.org/java/forums/t17036.html
public static void copyFile(File sourceFile, File destFile) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.nio.channels.FileChannel; public class Main { /**// w w w . j a v a2 s. c o m * Faster copying method from http://www.javalobby.org/java/forums/t17036.html */ public static void copyFile(File sourceFile, File destFile) throws IOException { if (!destFile.exists()) { destFile.createNewFile(); } try (FileChannel source = new FileInputStream(sourceFile).getChannel(); FileChannel destination = new FileOutputStream(destFile).getChannel()) { destination.transferFrom(source, 0, source.size()); } catch (Exception e) { System.out.println(e); } } }