public final class WebSocketChunkedInput extends java.lang.Object implements ChunkedInput<WebSocketFrame>
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.
构造器和说明 |
---|
WebSocketChunkedInput(ChunkedInput<ByteBuf> input)
Creates a new instance using the specified input.
|
WebSocketChunkedInput(ChunkedInput<ByteBuf> input,
int rsv)
Creates a new instance using the specified input.
|
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Releases the resources associated with the input.
|
boolean |
isEndOfInput()
Return
true if and only if there is no data left in the stream
and the stream has reached at its end. |
long |
length()
Returns the length of the input.
|
long |
progress()
Returns current transfer progress.
|
WebSocketFrame |
readChunk(ByteBufAllocator allocator)
Fetches a chunked data from the stream.
|
WebSocketFrame |
readChunk(ChannelHandlerContext ctx)
已过时。
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 . |
public WebSocketChunkedInput(ChunkedInput<ByteBuf> input)
input
- ChunkedInput
containing data to writepublic WebSocketChunkedInput(ChunkedInput<ByteBuf> input, int rsv)
input
- ChunkedInput
containing data to writersv
- RSV1, RSV2, RSV3 used for extensionsjava.lang.NullPointerException
- if input
is nullpublic boolean isEndOfInput() throws java.lang.Exception
ChunkedInput
true
if and only if there is no data left in the stream
and the stream has reached at its end.isEndOfInput
在接口中 ChunkedInput<WebSocketFrame>
true
if and only if there is no data left in the stream
and the stream has reached at its end.java.lang.Exception
public void close() throws java.lang.Exception
close
在接口中 ChunkedInput<WebSocketFrame>
java.lang.Exception
@Deprecated public WebSocketFrame readChunk(ChannelHandlerContext ctx) throws java.lang.Exception
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
.readChunk
在接口中 ChunkedInput<WebSocketFrame>
ctx
- ChannelHandlerContext
context of channelHandlerWebSocketFrame
contain chunk of datajava.lang.Exception
public WebSocketFrame readChunk(ByteBufAllocator allocator) throws java.lang.Exception
isEndOfInput()
call must return true
.readChunk
在接口中 ChunkedInput<WebSocketFrame>
allocator
- ByteBufAllocator
WebSocketFrame
contain chunk of datajava.lang.Exception
public long length()
ChunkedInput
length
在接口中 ChunkedInput<WebSocketFrame>
public long progress()
ChunkedInput
progress
在接口中 ChunkedInput<WebSocketFrame>