| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private final ConduitFactory | |
| protected PooledByteBuffer | currentBuffer
The streams buffer. |
| protected volatile Deflater | |
| private static final ByteBuffer | |
| private final HttpServerExchange | |
| private static final int | |
| private StreamSinkConduit | |
| private static final int | |
| protected final PooledObject | |
| private static final int | |
| private int | |
| private ByteBuffer | trailerBuffer
Buffer used to write the trailer if currentBuffer doesn't have enough space. |
| private WriteReadyHandler | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange)
|
| public | DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange, int deflateLevel)
|
| public | DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange, ObjectPool<Deflater> deflaterPool)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitWritable()
Implements org. Block until this channel becomes writable again. |
| public void | awaitWritable(final long
the time to wait time, final TimeUnit the time unit timeUnit)Implements org. Block until this conduit becomes writable again, or until the timeout expires. |
| private StreamSinkConduit | |
| private void | |
| public boolean | |
| private void | |
| protected byte[] | |
| public XnioWorker | getWorker()
Implements org. Get the XNIO worker associated with this conduit. |
| public XnioIoThread | getWriteThread()
Implements org. Get the write thread for this conduit. |
| public boolean | isWriteResumed()
Implements org. Determine whether write notifications are currently enabled. |
| public boolean | isWriteShutdown()
Implements org. Determine whether writes have been fully shut down on this conduit. |
| public static ObjectPool | |
| private boolean | Returns: false if there is still more to flushThe we are in the flushing state then we flush to the underlying stream, otherwise just return true |
| private boolean | |
| private boolean | |
| protected void | |
| private void | |
| public void | resumeWrites()
Implements org. Indicate that the conduit's |
| public void | setWriteReadyHandler(final WriteReadyHandler
the filter to receive readiness notifications handler)Implements org. Set the handler which should receive readiness notifications. |
| public static ObjectPool | |
| public void | suspendWrites()
Implements org. Indicate that calling the conduit's |
| public void | terminateWrites()
Implements org. Signal that no more write data is forthcoming. |
| public long | transferFrom(final FileChannel
the file to read from src, final long the position within the file from which the transfer is to begin position, final long the number of bytes to be transferred count)Implements org. Transfer bytes into this conduit from the given file. |
| public long | transferFrom(final StreamSourceChannel
the source to read from source, final long the number of bytes to be transferred count, final ByteBuffer the buffer to copy through. throughBuffer)Implements org. Transfers bytes from the given channel source. |
| public void | truncateWrites()
Implements org. Terminate writes and discard any outstanding write data. |
| public void | wakeupWrites()
Implements org. Indicate that the conduit's |
| public int | write(final ByteBuffer
the buffer containing data to write src)Implements org. Writes a sequence of bytes to this conduit from the given buffer. |
| public long | write(final ByteBuffer[]
the buffers containing data to write srcs, final int the offset into the buffer array offset, final int the number of buffers to write length)Implements org. Writes a sequence of bytes to this conduit from the given buffers. |
| public int | writeFinal(ByteBuffer
The data to write src)Implements org. Writes some data to the conduit, with the same semantics as
|
| public long | writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than srcs.length offset, int The maximum number of buffers to be accessed; must be
non-negative and no larger than
srcs.length - offset length)Implements org. Writes some data to the conduit, with the same semantics as
|
| CLOSED | back to summary |
|---|---|
| private static final int CLOSED | |
| conduitFactory | back to summary |
|---|---|
| private final ConduitFactory<StreamSinkConduit> conduitFactory | |
| currentBuffer | back to summary |
|---|---|
| protected PooledByteBuffer currentBuffer The streams buffer. This is freed when the next is shutdown | |
| deflater | back to summary |
|---|---|
| protected volatile Deflater deflater | |
| EMPTY | back to summary |
|---|---|
| private static final ByteBuffer EMPTY | |
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| FLUSHING_BUFFER | back to summary |
|---|---|
| private static final int FLUSHING_BUFFER | |
| next | back to summary |
|---|---|
| private StreamSinkConduit next | |
| NEXT_SHUTDOWN | back to summary |
|---|---|
| private static final int NEXT_SHUTDOWN | |
| pooledObject | back to summary |
|---|---|
| protected final PooledObject<Deflater> pooledObject | |
| SHUTDOWN | back to summary |
|---|---|
| private static final int SHUTDOWN | |
| state | back to summary |
|---|---|
| private int state | |
| trailerBuffer | back to summary |
|---|---|
| private ByteBuffer trailerBuffer Buffer used to write the trailer if currentBuffer doesn't have enough space. | |
| writeReadyHandler | back to summary |
|---|---|
| private WriteReadyHandler writeReadyHandler | |
| WRITES_RESUMED | back to summary |
|---|---|
| private static final int WRITES_RESUMED | |
| WRITTEN_TRAILER | back to summary |
|---|---|
| private static final int WRITTEN_TRAILER | |
| DeflatingStreamSinkConduit | back to summary |
|---|---|
| public DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange) | |
| DeflatingStreamSinkConduit | back to summary |
|---|---|
| public DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange, int deflateLevel) | |
| DeflatingStreamSinkConduit | back to summary |
|---|---|
| public DeflatingStreamSinkConduit(final ConduitFactory<StreamSinkConduit> conduitFactory, final HttpServerExchange exchange, ObjectPool<Deflater> deflaterPool) | |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable() throws IOException Implements org. Doc from org. Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException Implements org. Doc from org. Block until this conduit becomes writable again, or until the timeout expires. This method may return spuriously before the conduit becomes writable or the timeout expires.
| |
| createNextChannel | back to summary |
|---|---|
| private StreamSinkConduit createNextChannel() | |
| deflateData | back to summary |
|---|---|
| private void deflateData(boolean force) throws IOException Runs the current data through the deflater. As much as possible this will be buffered in the current output stream. | |
| flush | back to summary |
|---|---|
| public boolean flush() throws IOException Implements org. Doc from org. Flush out any unwritten, buffered output.
| |
| freeBuffer | back to summary |
|---|---|
| private void freeBuffer() | |
| getTrailer | back to summary |
|---|---|
| protected byte[] getTrailer() called before the stream is finally flushed. | |
| getWorker | back to summary |
|---|---|
| public XnioWorker getWorker() Implements org. Doc from org. Get the XNIO worker associated with this conduit.
| |
| getWriteThread | back to summary |
|---|---|
| public XnioIoThread getWriteThread() Implements org. Doc from org. Get the write thread for this conduit.
| |
| isWriteResumed | back to summary |
|---|---|
| public boolean isWriteResumed() Implements org. Doc from org. Determine whether write notifications are currently enabled.
| |
| isWriteShutdown | back to summary |
|---|---|
| public boolean isWriteShutdown() Implements org. Doc from org. Determine whether writes have been fully shut down on this conduit.
| |
| newInstanceDeflaterPool | back to summary |
|---|---|
| public static ObjectPool | |
| performFlushIfRequired | back to summary |
|---|---|
| private boolean performFlushIfRequired() throws IOException The we are in the flushing state then we flush to the underlying stream, otherwise just return true
| |
| performFlushIfRequiredAdditionalBuffer | back to summary |
|---|---|
| private boolean performFlushIfRequiredAdditionalBuffer() throws IOException | |
| performFlushIfRequiredSingleBuffer | back to summary |
|---|---|
| private boolean performFlushIfRequiredSingleBuffer() throws IOException | |
| postDeflate | back to summary |
|---|---|
| protected void postDeflate(ByteBuffer data) | |
| queueWriteListener | back to summary |
|---|---|
| private void queueWriteListener() | |
| resumeWrites | back to summary |
|---|---|
| public void resumeWrites() Implements org. Doc from org. Indicate that the conduit's
| |
| setWriteReadyHandler | back to summary |
|---|---|
| public void setWriteReadyHandler(final WriteReadyHandler handler) Implements org. Doc from org. Set the handler which should receive readiness notifications. A filter may pass this invocation on to the filter it wraps, or it may substitute itself.
| |
| simpleDeflaterPool | back to summary |
|---|---|
| public static ObjectPool | |
| suspendWrites | back to summary |
|---|---|
| public void suspendWrites() Implements org. Doc from org. Indicate that calling the conduit's
| |
| terminateWrites | back to summary |
|---|---|
| public void terminateWrites() throws IOException Implements org. Doc from org. Signal that no more write data is forthcoming. The conduit must be
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final FileChannel src, final long position, final long count) throws IOException Implements org. Doc from org. Transfer bytes into this conduit from the given file.
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException Implements org. Doc from org. Transfers bytes from the given channel source. On entry,
| |
| truncateWrites | back to summary |
|---|---|
| public void truncateWrites() throws IOException Implements org. Doc from org. Terminate writes and discard any outstanding write data. The conduit is terminated and flushed regardless of the outcome of this method.
| |
| wakeupWrites | back to summary |
|---|---|
| public void wakeupWrites() Implements org. Doc from org. Indicate that the conduit's
| |
| write | back to summary |
|---|---|
| public int write(final ByteBuffer src) throws IOException Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffer.
| |
| write | back to summary |
|---|---|
| public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffers.
| |
| writeFinal | back to summary |
|---|---|
| public int writeFinal(ByteBuffer src) throws IOException Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |
| writeFinal | back to summary |
|---|---|
| public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |