public static void copyFile(File srcFile, File destFile) throws IOException
    {
        InputStream reader = new FileInputStream(srcFile);
        OutputStream out = new FileOutputStream(destFile);
        try
        {
            byte[] buffer = new byte[2048];
            int n = 0;
            while (-1 != (n = reader.read(buffer))) 
            {
                out.write(buffer, 0, n);
            } 
        }
        finally
        {
            org.apache.commons.io.IOUtils.closeQuietly(out);
            org.apache.commons.io.IOUtils.closeQuietly(reader);
        }
    }
public static void copyFile ( File srcFile , File destFile ) throws IOException { InputStream reader = new FileInputStream ( srcFile ) ; OutputStream out = new FileOutputStream ( destFile ) ; try { byte [ ] buffer = new byte [ 2048 ] ; int n = 0 ; while ( - 1 != ( n = reader . read ( buffer ) ) ) { out . write ( buffer , 0 , n ) ; } } finally { org . apache . commons . io . IOUtils . closeQuietly ( out ) ; org . apache . commons . io . IOUtils . closeQuietly ( reader ) ; } }
<p>copyFile.</p>

@param srcFile a {@link java.io.File} object.
@param destFile a {@link java.io.File} object.
@throws java.io.IOException if any.