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) {