/// <exception cref="System.IO.IOException"></exception> public static void CopyFile(FilePath sourceFile, FilePath destFile) { if (!destFile.Exists()) { destFile.CreateNewFile(); } FileChannel source = null; FileChannel destination = null; try { source = new FileInputStream(sourceFile).GetChannel(); destination = new FileOutputStream(destFile).GetChannel(); destination.TransferFrom(source, 0, source.Size()); } finally { if (source != null) { source.Close(); } if (destination != null) { destination.Close(); } } }