Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  04cf8633_8ce7_e5aa_352b_1b23a309052f["decode()"]
  2421b439_cffa_67ca_b872_bb582dd0dbf2["RedisDecoder"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|defined in| 2421b439_cffa_67ca_b872_bb582dd0dbf2
  512a30b0_3427_a559_4bf5_8b6b149fe4ea["decodeType()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| 512a30b0_3427_a559_4bf5_8b6b149fe4ea
  f0bc4d3a_0846_bfbf_3cb8_e1666750a218["decodeInline()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| f0bc4d3a_0846_bfbf_3cb8_e1666750a218
  6d8b9b4b_2072_a961_76cb_8954875e821b["decodeLength()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| 6d8b9b4b_2072_a961_76cb_8954875e821b
  ac6bea2c_1fc9_64fa_127b_cc90adfb0557["decodeBulkStringEndOfLine()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| ac6bea2c_1fc9_64fa_127b_cc90adfb0557
  4dcee4b2_7f61_d951_b580_50f0852e5732["decodeBulkStringContent()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| 4dcee4b2_7f61_d951_b580_50f0852e5732
  fe09be93_7a87_7d9a_a4e2_1f26488d2f56["resetDecoder()"]
  04cf8633_8ce7_e5aa_352b_1b23a309052f -->|calls| fe09be93_7a87_7d9a_a4e2_1f26488d2f56
  style 04cf8633_8ce7_e5aa_352b_1b23a309052f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-redis/src/main/java/io/netty/handler/codec/redis/RedisDecoder.java lines 97–138

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        try {
            for (;;) {
                switch (state) {
                case DECODE_TYPE:
                    if (!decodeType(in)) {
                        return;
                    }
                    break;
                case DECODE_INLINE:
                    if (!decodeInline(in, out)) {
                        return;
                    }
                    break;
                case DECODE_LENGTH:
                    if (!decodeLength(in, out)) {
                        return;
                    }
                    break;
                case DECODE_BULK_STRING_EOL:
                    if (!decodeBulkStringEndOfLine(in, out)) {
                        return;
                    }
                    break;
                case DECODE_BULK_STRING_CONTENT:
                    if (!decodeBulkStringContent(in, out)) {
                        return;
                    }
                    break;
                default:
                    throw new RedisCodecException("Unknown state: " + state);
                }
            }
        } catch (RedisCodecException e) {
            resetDecoder();
            throw e;
        } catch (Exception e) {
            resetDecoder();
            throw new RedisCodecException(e);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-redis/src/main/java/io/netty/handler/codec/redis/RedisDecoder.java.
Where is decode() defined?
decode() is defined in codec-redis/src/main/java/io/netty/handler/codec/redis/RedisDecoder.java at line 97.
What does decode() call?
decode() calls 6 function(s): decodeBulkStringContent, decodeBulkStringEndOfLine, decodeInline, decodeLength, decodeType, resetDecoder.

Analyze Your Own Codebase

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

Try Supermodel Free