getRemaining() to see if more bytes were pending when the channel was
closed.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpServerExchange | |
| private final ConduitListener | |
| private static final long | |
| private static final long | |
| private static final long | |
| private static final long | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | FixedLengthStreamSourceConduit(final StreamSourceConduit
the stream source channel to read from next, final long the amount of content to read contentLength, final ConduitListener<? super FixedLengthStreamSourceConduit> the listener to call once the stream is exhausted or closed finishListener, final HttpServerExchange The server exchange. This is used to determine the max size exchange)Construct a new instance. |
| public | FixedLengthStreamSourceConduit(final StreamSourceConduit
the stream source channel to read from next, final long the amount of content to read contentLength, final ConduitListener<? super FixedLengthStreamSourceConduit> the listener to call once the stream is exhausted or closed finishListener)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitReadable()
Overrides org. Implements org. Block until this channel becomes readable again. |
| public void | awaitReadable(final long
the time to wait time, final TimeUnit the time unit timeUnit)Overrides org. Implements org. Block until this conduit becomes readable again, or until the timeout expires. |
| private void | |
| private void | |
| private long | |
| private void | |
| private void | |
| public long | |
| private void | |
| public boolean | isReadResumed()
Overrides org. Implements org. Determine whether read notifications are currently enabled. |
| public long | read(final ByteBuffer[]
the buffers to fill with data from the conduit dsts, final int the offset into the buffer array offset, final int the number of buffers to fill length)Overrides org. Implements org. Read a sequence of bytes from this conduit to the given buffers. |
| public long | |
| public int | read(final ByteBuffer
the buffer to fill with data from the conduit dst)Overrides org. Implements org. Read a sequence of bytes from this conduit to the given buffer. |
| public void | resumeReads()
Overrides org. Implements org. Indicate that the conduit's |
| public void | terminateReads()
Overrides org. Implements org. Indicate that no more data will be read from this conduit. |
| public long | transferTo(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, final FileChannel the file to write to target)Overrides org. Implements org. Transfers bytes into the given file from this channel. |
| public long | transferTo(final long
the number of bytes to be transferred count, final ByteBuffer the buffer to copy through. throughBuffer, final StreamSinkChannel the destination to write to target)Overrides org. Implements org. Transfers bytes into the given channel target. |
| public void | wakeupReads()
Overrides org. Implements org. Indicate that the conduit's |
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| finishListener | back to summary |
|---|---|
| private final ConduitListener<? super FixedLengthStreamSourceConduit> finishListener | |
| FLAG_CLOSED | back to summary |
|---|---|
| private static final long FLAG_CLOSED | |
| FLAG_FINISHED | back to summary |
|---|---|
| private static final long FLAG_FINISHED | |
| FLAG_LENGTH_CHECKED | back to summary |
|---|---|
| private static final long FLAG_LENGTH_CHECKED | |
| MASK_COUNT | back to summary |
|---|---|
| private static final long MASK_COUNT | |
| state | back to summary |
|---|---|
private long state
| |
| FixedLengthStreamSourceConduit | back to summary |
|---|---|
| public FixedLengthStreamSourceConduit(final StreamSourceConduit next, final long contentLength, final ConduitListener<? super FixedLengthStreamSourceConduit> finishListener, final HttpServerExchange exchange) Construct a new instance. The given listener is called once all the bytes are read from the stream or the stream is closed. This listener should cause the remaining data to be drained from the underlying stream if the underlying stream is to be reused.
Calling this constructor will replace the read listener of the underlying channel. The listener should be
restored from the
| |
| FixedLengthStreamSourceConduit | back to summary |
|---|---|
| public FixedLengthStreamSourceConduit(final StreamSourceConduit next, final long contentLength, final ConduitListener<? super FixedLengthStreamSourceConduit> finishListener) Construct a new instance. The given listener is called once all the bytes are read from the stream or the stream is closed. This listener should cause the remaining data to be drained from the underlying stream if the underlying stream is to be reused.
Calling this constructor will replace the read listener of the underlying channel. The listener should be
restored from the
| |
| awaitReadable | back to summary |
|---|---|
| public void awaitReadable() throws IOException Overrides org. Implements org. Doc from org. Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.
| |
| awaitReadable | back to summary |
|---|---|
| public void awaitReadable(final long time, final TimeUnit timeUnit) throws IOException Overrides org. Implements org. Doc from org. Block until this conduit becomes readable again, or until the timeout expires. This method may return spuriously before the conduit becomes readable or the timeout expires.
| |
| checkMaxSize | back to summary |
|---|---|
| private void checkMaxSize(long state) throws IOException | |
| closeConnection | back to summary |
|---|---|
| private void closeConnection() | |
| enterShutdownReads | back to summary |
|---|---|
| private long enterShutdownReads() | |
| exitRead | back to summary |
|---|---|
| private void exitRead(long consumed, Throwable readError) throws IOException Exit a read method.
| |
| exitShutdownReads | back to summary |
|---|---|
| private void exitShutdownReads(long oldVal) | |
| getRemaining | back to summary |
|---|---|
| public long getRemaining() Get the number of remaining bytes.
| |
| invokeFinishListener | back to summary |
|---|---|
| private void invokeFinishListener() | |
| isReadResumed | back to summary |
|---|---|
| public boolean isReadResumed() Overrides org. Implements org. Doc from org. Determine whether read notifications are currently enabled.
| |
| read | back to summary |
|---|---|
| public long read(final ByteBuffer[] dsts, final int offset, final int length) throws IOException Overrides org. Implements org. Doc from org. Read a sequence of bytes from this conduit to the given buffers.
| |
| read | back to summary |
|---|---|
| public long read(final ByteBuffer[] dsts) throws IOException | |
| read | back to summary |
|---|---|
| public int read(final ByteBuffer dst) throws IOException Overrides org. Implements org. Doc from org. Read a sequence of bytes from this conduit to the given buffer.
| |
| resumeReads | back to summary |
|---|---|
| public void resumeReads() Overrides org. Implements org. Doc from org. Indicate that the conduit's
| |
| terminateReads | back to summary |
|---|---|
| public void terminateReads() throws IOException Overrides org. Implements org. Doc from org. Indicate that no more data will be read from this conduit. If unread data exists, an exception may be thrown.
| |
| transferTo | back to summary |
|---|---|
| public long transferTo(final long position, final long count, final FileChannel target) throws IOException Overrides org. Implements org. Doc from org. Transfers bytes into the given file from this channel.
| |
| transferTo | back to summary |
|---|---|
| public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException Overrides org. Implements org. Doc from org. Transfers bytes into the given channel target. On entry,
| |
| wakeupReads | back to summary |
|---|---|
| public void wakeupReads() Overrides org. Implements org. Doc from org. Indicate that the conduit's | |