count = inChannel.transferTo(offset, inChannel.size() - offset, outChannel);
} else if (output instanceof FileOutputStream) {
FileChannel outChannel = ((FileOutputStream) output).getChannel();
ReadableByteChannel inChannel = Channels.newChannel(input);
do {
n = outChannel.transferFrom(inChannel, offset + count, DEFAULT_BUFFER_SIZE);
count += n;
} while (n > 0);
} else {
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];