Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  812c447b_612a_54b1_3bc3_a2cdae4c07e3["decode()"]
  f85a4b1a_55ed_4666_acfd_439f0c3341dc["CompatibleMarshallingDecoder"]
  812c447b_612a_54b1_3bc3_a2cdae4c07e3 -->|defined in| f85a4b1a_55ed_4666_acfd_439f0c3341dc
  bf44fa6d_9245_ee8d_993c_5f965110bb10["decodeLast()"]
  bf44fa6d_9245_ee8d_993c_5f965110bb10 -->|calls| 812c447b_612a_54b1_3bc3_a2cdae4c07e3
  style 812c447b_612a_54b1_3bc3_a2cdae4c07e3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-marshalling/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java lines 57–83

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out) throws Exception {
        if (discardingTooLongFrame) {
            buffer.skipBytes(actualReadableBytes());
            checkpoint();
            return;
        }

        Unmarshaller unmarshaller = provider.getUnmarshaller(ctx);
        ByteInput input = new ChannelBufferByteInput(buffer);
        if (maxObjectSize != Integer.MAX_VALUE) {
            input = new LimitingByteInput(input, maxObjectSize);
        }
        try {
            unmarshaller.start(input);
            Object obj = unmarshaller.readObject();
            unmarshaller.finish();
            out.add(obj);
        } catch (LimitingByteInput.TooBigObjectException ignored) {
            discardingTooLongFrame = true;
            throw new TooLongFrameException();
        } finally {
            // Call close in a finally block as the ReplayingDecoder will throw an Error if not enough bytes are
            // readable. This helps to be sure that we do not leak resource
            unmarshaller.close();
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-marshalling/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java.
Where is decode() defined?
decode() is defined in codec-marshalling/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java at line 57.
What calls decode()?
decode() is called by 1 function(s): decodeLast.

Analyze Your Own Codebase

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

Try Supermodel Free