ChunkedInput that fetches data from a ReadableByteChannel
chunk by chunk. Please note that the ReadableByteChannel must
operate in blocking mode. Non-blocking mode channels are not supported.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer | byteBuffer
Associated ByteBuffer |
| private final int | |
| private final ReadableByteChannel | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | ChunkedNioStream(ReadableByteChannel in)
Creates a new instance that fetches data from the specified channel. |
| public | ChunkedNioStream(ReadableByteChannel in, int
the number of bytes to fetch on each
chunkSize)readChunk(ChannelHandlerContext) callCreates a new instance that fetches data from the specified channel. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements io. |
| public boolean | isEndOfInput()
Implements io. true if and only if there is no data left in the stream
and the stream has reached at its end.
|
| public long | |
| public long | progress()
Implements io. |
| public ByteBuf | readChunk(ChannelHandlerContext
The context which provides a ctx)ByteBufAllocator if buffer allocation is necessary.Implements io.
Deprecated
|
| public ByteBuf | readChunk(ByteBufAllocator
ByteBufAllocator if buffer allocation is necessary.Implements io. |
| public long |
| byteBuffer | back to summary |
|---|---|
| private final ByteBuffer byteBuffer Associated ByteBuffer | |
| chunkSize | back to summary |
|---|---|
| private final int chunkSize | |
| in | back to summary |
|---|---|
| private final ReadableByteChannel in | |
| offset | back to summary |
|---|---|
| private long offset | |
| ChunkedNioStream | back to summary |
|---|---|
| public ChunkedNioStream(ReadableByteChannel in) Creates a new instance that fetches data from the specified channel. | |
| ChunkedNioStream | back to summary |
|---|---|
| public ChunkedNioStream(ReadableByteChannel in, int chunkSize) Creates a new instance that fetches data from the specified channel.
| |
| close | back to summary |
|---|---|
| public void close() throws Exception Implements io. Doc from io. Releases the resources associated with the input.
| |
| isEndOfInput | back to summary |
|---|---|
| public boolean isEndOfInput() throws Exception Implements io. Doc from io. Return
| |
| length | back to summary |
|---|---|
| public long length() Implements io. Doc from io. Returns the length of the input.
| |
| progress | back to summary |
|---|---|
| public long progress() Implements io. Doc from io. Returns current transfer progress.
| |
| readChunk | back to summary |
|---|---|
| public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception Implements io. Deprecated
| |
| readChunk | back to summary |
|---|---|
| public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception Implements io. Doc from io. Fetches a chunked data from the stream. Once this method returns the last chunk
and thus the stream has reached at its end, any subsequent
| |
| transferredBytes | back to summary |
|---|---|
| public long transferredBytes() Returns the number of transferred bytes. | |