encode() — netty Function Reference
Architecture documentation for the encode() function in ProtobufVarint32LengthFieldPrepender.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ed001db2_9529_f359_c93b_c3e10aed6648["encode()"] c802204f_c6f7_7dc6_7b18_0b760262838a["ProtobufVarint32LengthFieldPrepender"] ed001db2_9529_f359_c93b_c3e10aed6648 -->|defined in| c802204f_c6f7_7dc6_7b18_0b760262838a 9714be53_8fbd_3ba3_4cd4_53e89932050b["computeRawVarint32Size()"] ed001db2_9529_f359_c93b_c3e10aed6648 -->|calls| 9714be53_8fbd_3ba3_4cd4_53e89932050b 36032e25_3b9d_d43b_2b28_b7289870c8d7["writeRawVarint32()"] ed001db2_9529_f359_c93b_c3e10aed6648 -->|calls| 36032e25_3b9d_d43b_2b28_b7289870c8d7 style ed001db2_9529_f359_c93b_c3e10aed6648 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java lines 47–55
@Override
protected void encode(
ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception {
int bodyLen = msg.readableBytes();
int headerLen = computeRawVarint32Size(bodyLen);
out.ensureWritable(headerLen + bodyLen);
writeRawVarint32(out, bodyLen);
out.writeBytes(msg, msg.readerIndex(), bodyLen);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does encode() do?
encode() is a function in the netty codebase, defined in codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java.
Where is encode() defined?
encode() is defined in codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java at line 47.
What does encode() call?
encode() calls 2 function(s): computeRawVarint32Size, writeRawVarint32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free