WebSocketChunkedInput Class — netty Architecture
Architecture documentation for the WebSocketChunkedInput class in WebSocketChunkedInput.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD e0654ec5_9441_c4c6_57ff_62fcc228252d["WebSocketChunkedInput"] 5237e82f_a7ab_4582_ce3f_19ddecfbfea7["WebSocketChunkedInput.java"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|defined in| 5237e82f_a7ab_4582_ce3f_19ddecfbfea7 e300478d_1153_7eec_ee52_dd6b025b3803["WebSocketChunkedInput()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| e300478d_1153_7eec_ee52_dd6b025b3803 4402035a_ebfa_9f2b_83ab_ca764d7fc5da["isEndOfInput()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| 4402035a_ebfa_9f2b_83ab_ca764d7fc5da 3e07aa31_5eda_1aa0_58da_24bc2b893fff["close()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| 3e07aa31_5eda_1aa0_58da_24bc2b893fff 807c077f_6180_bd3d_2ff0_f230329828b0["WebSocketFrame()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| 807c077f_6180_bd3d_2ff0_f230329828b0 9d52e0a4_1e38_2958_b010_034e59c8831c["length()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| 9d52e0a4_1e38_2958_b010_034e59c8831c 427e3373_92ee_bff9_534f_bbbad7943334["progress()"] e0654ec5_9441_c4c6_57ff_62fcc228252d -->|method| 427e3373_92ee_bff9_534f_bbbad7943334
Relationship Graph
Source Code
codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketChunkedInput.java lines 31–114
public final class WebSocketChunkedInput implements ChunkedInput<WebSocketFrame> {
private final ChunkedInput<ByteBuf> input;
private final int rsv;
/**
* Creates a new instance using the specified input.
* @param input {@link ChunkedInput} containing data to write
*/
public WebSocketChunkedInput(ChunkedInput<ByteBuf> input) {
this(input, 0);
}
/**
* Creates a new instance using the specified input.
* @param input {@link ChunkedInput} containing data to write
* @param rsv RSV1, RSV2, RSV3 used for extensions
*
* @throws NullPointerException if {@code input} is null
*/
public WebSocketChunkedInput(ChunkedInput<ByteBuf> input, int rsv) {
this.input = ObjectUtil.checkNotNull(input, "input");
this.rsv = rsv;
}
/**
* @return {@code true} if and only if there is no data left in the stream
* and the stream has reached at its end.
*/
@Override
public boolean isEndOfInput() throws Exception {
return input.isEndOfInput();
}
/**
* Releases the resources associated with the input.
*/
@Override
public void close() throws Exception {
input.close();
}
/**
* @deprecated Use {@link #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 {@link #isEndOfInput()}
* call must return {@code true}.
*
* @param ctx {@link ChannelHandlerContext} context of channelHandler
* @return {@link WebSocketFrame} contain chunk of data
*/
@Deprecated
@Override
public WebSocketFrame readChunk(ChannelHandlerContext ctx) throws Exception {
return readChunk(ctx.alloc());
}
/**
* 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 {@link #isEndOfInput()}
* call must return {@code true}.
*
* @param allocator {@link ByteBufAllocator}
* @return {@link WebSocketFrame} contain chunk of data
*/
@Override
public WebSocketFrame readChunk(ByteBufAllocator allocator) throws Exception {
ByteBuf buf = input.readChunk(allocator);
if (buf == null) {
return null;
}
return new ContinuationWebSocketFrame(input.isEndOfInput(), rsv, buf);
}
@Override
public long length() {
return input.length();
}
@Override
public long progress() {
Defined In
Source
Frequently Asked Questions
What is the WebSocketChunkedInput class?
WebSocketChunkedInput is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketChunkedInput.java.
Where is WebSocketChunkedInput defined?
WebSocketChunkedInput is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketChunkedInput.java at line 31.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free