if (ch.getPipeline().get(SslHandler.class) == null) {
final FadvisedFileRegionWrapper partition = new FadvisedFileRegionWrapper(spill,
file.startOffset, file.length(), manageOsCache, readaheadLength,
readaheadPool, file.getFile().getAbsolutePath());
writeFuture = ch.write(partition);
writeFuture.addListener(new FileCloseListener(partition));
} else {
// HTTPS cannot be done with zero copy.
final FadvisedChunkedFile chunk = new FadvisedChunkedFile(spill,
file.startOffset, file.length, sslFileBufferSize,
manageOsCache, readaheadLength, readaheadPool,