// Send the response headers to the client.
future = e.getChannel().write(output);
if (lowRange != DLNAMediaInfo.ENDFILE_POS && !method.equals("HEAD")) {
// Send the response body to the client in chunks.
ChannelFuture chunkWriteFuture = e.getChannel().write(new ChunkedStream(inputStream, BUFFER_SIZE));
// Add a listener to clean up after sending the entire response body.
chunkWriteFuture.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) {