Top Description Methods
io.netty.handler.stream

public Interface ChunkedInput<B>

Known Direct Implementers
io.netty.handler.stream.ChunkedNioFile, io.netty.handler.stream.ChunkedNioStream, io.netty.handler.stream.ChunkedStream, io.netty.handler.stream.ChunkedFile
Imports
io.netty.buffer.ByteBufAllocator, io.netty.channel.ChannelHandlerContext

A data stream of indefinite length which is consumed by ChunkedWriteHandler.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Releases the resources associated with the input.

public boolean
isEndOfInput()

Return true if and only if there is no data left in the stream and the stream has reached at its end.

public long

Returns:

the length of the input if the length of the input is known. a negative value if the length of the input is unknown.
length
()

Returns the length of the input.

public long
progress()

Returns current transfer progress.

public B

Returns:

the fetched chunk. null if there is no data left in the stream. Please note that null does not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily.
readChunk
(ChannelHandlerContext
The context which provides a ByteBufAllocator if buffer allocation is necessary.
ctx
)

Deprecated Use readChunk(ByteBufAllocator).
public B

Returns:

the fetched chunk. null if there is no data left in the stream. Please note that null does not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily.
readChunk
(ByteBufAllocator
ByteBufAllocator if buffer allocation is necessary.
allocator
)

Fetches a chunked data from the stream.

Method Detail

closeback to summary
public void close() throws Exception

Releases the resources associated with the input.

isEndOfInputback to summary
public boolean isEndOfInput() throws Exception

Return true if and only if there is no data left in the stream and the stream has reached at its end.

lengthback to summary
public long length()

Returns the length of the input.

Returns:long

the length of the input if the length of the input is known. a negative value if the length of the input is unknown.

progressback to summary
public long progress()

Returns current transfer progress.

readChunkback to summary
public B readChunk(ChannelHandlerContext ctx) throws Exception

Deprecated

Use readChunk(ByteBufAllocator).

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 isEndOfInput() call must return true.

Parameters
ctx:ChannelHandlerContext

The context which provides a ByteBufAllocator if buffer allocation is necessary.

Returns:B

the fetched chunk. null if there is no data left in the stream. Please note that null does not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily.

Annotations
@Deprecated
readChunkback to summary
public B readChunk(ByteBufAllocator allocator) throws Exception

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 isEndOfInput() call must return true.

Parameters
allocator:ByteBufAllocator

ByteBufAllocator if buffer allocation is necessary.

Returns:B

the fetched chunk. null if there is no data left in the stream. Please note that null does not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily.