Package io.netty.handler.stream
Interface ChunkedInput<B>
-
- All Known Implementing Classes:
ChunkedFile,ChunkedNioFile,ChunkedNioStream,ChunkedStream,Http2DataChunkedInput,HttpChunkedInput,HttpPostRequestEncoder,WebSocketChunkedInput
public interface ChunkedInput<B>A data stream of indefinite length which is consumed byChunkedWriteHandler.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclose()Releases the resources associated with the input.booleanisEndOfInput()Returntrueif and only if there is no data left in the stream and the stream has reached at its end.longlength()Returns the length of the input.longprogress()Returns current transfer progress.BreadChunk(ByteBufAllocator allocator)Fetches a chunked data from the stream.BreadChunk(ChannelHandlerContext ctx)Deprecated.
-
-
-
Method Detail
-
isEndOfInput
boolean isEndOfInput() throws java.lang.ExceptionReturntrueif and only if there is no data left in the stream and the stream has reached at its end.- Throws:
java.lang.Exception
-
close
void close() throws java.lang.ExceptionReleases the resources associated with the input.- Throws:
java.lang.Exception
-
readChunk
@Deprecated B readChunk(ChannelHandlerContext ctx) throws java.lang.Exception
Deprecated.UsereadChunk(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 returntrue.- Parameters:
ctx- The context which provides aByteBufAllocatorif buffer allocation is necessary.- Returns:
- the fetched chunk.
nullif there is no data left in the stream. Please note thatnulldoes not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily. - Throws:
java.lang.Exception
-
readChunk
B readChunk(ByteBufAllocator allocator) throws java.lang.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 subsequentisEndOfInput()call must returntrue.- Parameters:
allocator-ByteBufAllocatorif buffer allocation is necessary.- Returns:
- the fetched chunk.
nullif there is no data left in the stream. Please note thatnulldoes not necessarily mean that the stream has reached at its end. In a slow stream, the next chunk might be unavailable just momentarily. - Throws:
java.lang.Exception
-
length
long length()
Returns the length of the input.- 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.
-
progress
long progress()
Returns current transfer progress.
-
-