// clear the internal buffers; sendfile content is exclusive
reset();
// additional precondition validation performed by FileTransfer
// constructor
final FileTransfer f = new FileTransfer(file, offset, length);
// lock further sendfile requests out
fileTransferRequested = true;
outputHeader.setContentLengthLong(f.remaining());
if (outputHeader.getContentType() == null) {
outputHeader.setContentType(MimeType.getByFilename(file.getName()));
}
// set Content-Encoding to identity to prevent compression
outputHeader.setHeader(Header.ContentEncoding, HeaderValue.IDENTITY);