public class ServerOutputBuffer extends OutputBuffer
OutputBuffer.LifeCycleListenerLOGGER, sendfileEnabled| Constructor and Description |
|---|
ServerOutputBuffer() |
| Modifier and Type | Method and Description |
|---|---|
protected Executor |
getThreadPool() |
void |
initialize(Response response,
FilterChainContext ctx) |
void |
recycle()
Recycle the output buffer.
|
void |
sendfile(File file,
long offset,
long length,
CompletionHandler<WriteResult> handler)
Will use
FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
to send file to the remote endpoint. |
acknowledge, canWrite, canWrite, canWriteChar, close, endRequest, flush, getBufferedDataSize, getBufferSize, initialize, isAsyncEnabled, isClosed, notifyCanWrite, notifyCanWrite, prepareCharacterEncoder, registerLifeCycleListener, removeLifeCycleListener, reset, sendfile, setAsyncEnabled, setBufferSize, write, write, write, write, write, write, writeBuffer, writeByte, writeByteBuffer, writeCharpublic void initialize(Response response, FilterChainContext ctx)
public void sendfile(File file, long offset, long length, CompletionHandler<WriteResult> handler)
OutputBuffer
Will use FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
to send file to the remote endpoint. Note that all headers necessary
for the file transfer must be set prior to invoking this method as this will
case the HTTP header to be flushed to the client prior to sending the file
content. This should also be the last call to write any content to the remote
endpoint.
It's required that the response be suspended when using this functionality. It will be assumed that if the response wasn't suspended when this method is called, that it's desired that this method manages the suspend/resume cycle.
sendfile in class OutputBufferfile - the File to transfer.offset - the starting offset within the Filelength - the total number of bytes to transferhandler - CompletionHandler that will be notified
of the transfer progress/completion or failure.public void recycle()
OutputBufferrecycle in class OutputBufferprotected Executor getThreadPool()
getThreadPool in class OutputBufferExecutor, which will be used for notifying user
registered WriteHandler.Copyright © 2012-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.