Home / Function/ callDecode() — netty Function Reference

callDecode() — netty Function Reference

Architecture documentation for the callDecode() function in ByteToMessageDecoder.java from the netty codebase.

Function java Buffer Allocators calls 4 called by 2

Entity Profile

Dependency Diagram

graph TD
  8a34ecfc_930b_5500_f979_83efbe7a340e["callDecode()"]
  efe4959f_3296_dbb1_4a4b_76b9d7ccec55["ByteToMessageDecoder"]
  8a34ecfc_930b_5500_f979_83efbe7a340e -->|defined in| efe4959f_3296_dbb1_4a4b_76b9d7ccec55
  a22162a0_4ee0_09dc_f31c_e78971c0c57d["channelRead()"]
  a22162a0_4ee0_09dc_f31c_e78971c0c57d -->|calls| 8a34ecfc_930b_5500_f979_83efbe7a340e
  1ab7897f_cdf1_0b3e_43e2_77270fef19fa["channelInputClosed()"]
  1ab7897f_cdf1_0b3e_43e2_77270fef19fa -->|calls| 8a34ecfc_930b_5500_f979_83efbe7a340e
  07d205b6_501b_721f_b872_e8e378f3c54d["fireChannelRead()"]
  8a34ecfc_930b_5500_f979_83efbe7a340e -->|calls| 07d205b6_501b_721f_b872_e8e378f3c54d
  ee472e33_1a7d_641f_3906_3ad2ada7997f["decodeRemovalReentryProtection()"]
  8a34ecfc_930b_5500_f979_83efbe7a340e -->|calls| ee472e33_1a7d_641f_3906_3ad2ada7997f
  a2b41b20_4228_5c5c_610d_6731a6923ad0["decode()"]
  8a34ecfc_930b_5500_f979_83efbe7a340e -->|calls| a2b41b20_4228_5c5c_610d_6731a6923ad0
  29f844ed_a291_7f4c_f37d_0ff1c0a41a8a["isSingleDecode()"]
  8a34ecfc_930b_5500_f979_83efbe7a340e -->|calls| 29f844ed_a291_7f4c_f37d_0ff1c0a41a8a
  style 8a34ecfc_930b_5500_f979_83efbe7a340e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java lines 464–517

    protected void callDecode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
        try {
            while (in.isReadable()) {
                final int outSize = out.size();

                if (outSize > 0) {
                    fireChannelRead(ctx, out, outSize);
                    out.clear();

                    // Check if this handler was removed before continuing with decoding.
                    // If it was removed, it is not safe to continue to operate on the buffer.
                    //
                    // See:
                    // - https://github.com/netty/netty/issues/4635
                    if (ctx.isRemoved()) {
                        break;
                    }
                }

                int oldInputLength = in.readableBytes();
                decodeRemovalReentryProtection(ctx, in, out);

                // Check if this handler was removed before continuing the loop.
                // If it was removed, it is not safe to continue to operate on the buffer.
                //
                // See https://github.com/netty/netty/issues/1664
                if (ctx.isRemoved()) {
                    break;
                }

                if (out.isEmpty()) {
                    if (oldInputLength == in.readableBytes()) {
                        break;
                    } else {
                        continue;
                    }
                }

                if (oldInputLength == in.readableBytes()) {
                    throw new DecoderException(
                            StringUtil.simpleClassName(getClass()) +
                                    ".decode() did not read anything but decoded a message.");
                }

                if (isSingleDecode()) {
                    break;
                }
            }
        } catch (DecoderException e) {
            throw e;
        } catch (Exception cause) {
            throw new DecoderException(cause);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does callDecode() do?
callDecode() is a function in the netty codebase, defined in codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java.
Where is callDecode() defined?
callDecode() is defined in codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java at line 464.
What does callDecode() call?
callDecode() calls 4 function(s): decode, decodeRemovalReentryProtection, fireChannelRead, isSingleDecode.
What calls callDecode()?
callDecode() is called by 2 function(s): channelInputClosed, channelRead.

Analyze Your Own Codebase

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

Try Supermodel Free