Top Description Fields Constructors Methods
io.netty5.handler.codec.http.websocketx

public final Class WebSocketChunkedInput

extends Object
implements ChunkedInput<WebSocketFrame>
Class Inheritance
All Implemented Interfaces
io.netty5.handler.stream.ChunkedInput, java.lang.AutoCloseable
Imports
io.netty5.buffer.Buffer, .BufferAllocator, io.netty5.handler.stream.ChunkedInput

A ChunkedInput that fetches data chunk by chunk for use with WebSocket chunked transfers.

Each chunk from the input data will be wrapped within a ContinuationWebSocketFrame. At the end of the input data, ContinuationWebSocketFrame with finalFragment will be written.

Field Summary

Modifier and TypeField and Description
private final ChunkedInput<Buffer>
private final int

Constructor Summary

AccessConstructor and Description
public
WebSocketChunkedInput(ChunkedInput<Buffer>
ChunkedInput containing data to write
input
)

Creates a new instance using the specified input.

public
WebSocketChunkedInput(ChunkedInput<Buffer>
ChunkedInput containing data to write
input
,
int
RSV1, RSV2, RSV3 used for extensions
rsv
)

Creates a new instance using the specified input.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.lang.AutoCloseable.close.

Releases the resources associated with the input.
public boolean

Returns:

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

Implements io.netty5.handler.stream.ChunkedInput.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
length()

Implements io.netty5.handler.stream.ChunkedInput.length.

Returns the length of the input.
public long
progress()

Implements io.netty5.handler.stream.ChunkedInput.progress.

Returns current transfer progress.
public WebSocketFrame

Returns:

WebSocketFrame contain chunk of data
readChunk
(BufferAllocator allocator)

Implements io.netty5.handler.stream.ChunkedInput.readChunk.

Fetches a chunked data from the stream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputback to summary
private final ChunkedInput<Buffer> input
rsvback to summary
private final int rsv

Constructor Detail

WebSocketChunkedInputback to summary
public WebSocketChunkedInput(ChunkedInput<Buffer> input)

Creates a new instance using the specified input.

Parameters
input:ChunkedInput<Buffer>

ChunkedInput containing data to write

WebSocketChunkedInputback to summary
public WebSocketChunkedInput(ChunkedInput<Buffer> input, int rsv)

Creates a new instance using the specified input.

Parameters
input:ChunkedInput<Buffer>

ChunkedInput containing data to write

rsv:int

RSV1, RSV2, RSV3 used for extensions

Exceptions
NullPointerException:
if input is null

Method Detail

closeback to summary
public void close() throws Exception

Implements java.lang.AutoCloseable.close.

Releases the resources associated with the input.

Annotations
@Override
Exceptions
Exception:

Doc from java.lang.AutoCloseable.close.

if this resource cannot be closed

isEndOfInputback to summary
public boolean isEndOfInput() throws Exception

Implements io.netty5.handler.stream.ChunkedInput.isEndOfInput.

Doc from io.netty5.handler.stream.ChunkedInput.isEndOfInput.

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

Returns:boolean

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

Annotations
@Override
lengthback to summary
public long length()

Implements io.netty5.handler.stream.ChunkedInput.length.

Doc from io.netty5.handler.stream.ChunkedInput.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.

Annotations
@Override
progressback to summary
public long progress()

Implements io.netty5.handler.stream.ChunkedInput.progress.

Doc from io.netty5.handler.stream.ChunkedInput.progress.

Returns current transfer progress.

Annotations
@Override
readChunkback to summary
public WebSocketFrame readChunk(BufferAllocator allocator) throws Exception

Implements io.netty5.handler.stream.ChunkedInput.readChunk.

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:BufferAllocator

BufferAllocator

Returns:WebSocketFrame

WebSocketFrame contain chunk of data

Annotations
@Override