Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

Architecture documentation for the decode() function in ProtobufDecoderNano.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1441d3aa_2ead_f9d4_ff1f_df2ff53ef6e7["decode()"]
  5026f899_3152_4967_182c_1f98ed56e525["ProtobufDecoderNano"]
  1441d3aa_2ead_f9d4_ff1f_df2ff53ef6e7 -->|defined in| 5026f899_3152_4967_182c_1f98ed56e525
  style 1441d3aa_2ead_f9d4_ff1f_df2ff53ef6e7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoderNano.java lines 73–88

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out)
            throws Exception {
        final byte[] array;
        final int offset;
        final int length = msg.readableBytes();
        if (msg.hasArray()) {
            array = msg.array();
            offset = msg.arrayOffset() + msg.readerIndex();
        } else {
            array = ByteBufUtil.getBytes(msg, msg.readerIndex(), length, false);
            offset = 0;
        }
        MessageNano prototype = clazz.getConstructor().newInstance();
        out.add(MessageNano.mergeFrom(prototype, array, offset, length));
    }

Domain

Subdomains

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoderNano.java.
Where is decode() defined?
decode() is defined in codec-protobuf/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoderNano.java at line 73.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free