public static final void copyFileNIO(File originFile, File destinationFile) {
FileInputStream inputStream = null;
FileOutputStream outputStream = null;
try {
inputStream = new FileInputStream(originFile);
FileChannel srcChannel = inputStream.getChannel();
if (!destinationFile.exists())
destinationFile.createNewFile();
outputStream = new FileOutputStream(destinationFile);
FileChannel dstChannel = outputStream.getChannel();
long bytesToTransfer = srcChannel.size();
long position = 0;
while (bytesToTransfer > 0) {
long bytesTransferred = dstChannel.transferFrom(srcChannel, position, bytesToTransfer);
position += bytesTransferred;
bytesToTransfer -= bytesTransferred;
}
} catch (IOException e) {