Home / Function/ decodeLiteral() — netty Function Reference

decodeLiteral() — netty Function Reference

Architecture documentation for the decodeLiteral() function in Snappy.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7210bee0_d5c7_4186_aa1a_9a8f95e1e757["decodeLiteral()"]
  6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8["Snappy"]
  7210bee0_d5c7_4186_aa1a_9a8f95e1e757 -->|defined in| 6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8
  f2623adf_f9d0_6b9a_01bf_992a8c89c1e8["decode()"]
  f2623adf_f9d0_6b9a_01bf_992a8c89c1e8 -->|calls| 7210bee0_d5c7_4186_aa1a_9a8f95e1e757
  style 7210bee0_d5c7_4186_aa1a_9a8f95e1e757 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java lines 454–494

    static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) {
        in.markReaderIndex();
        int length;
        switch(tag >> 2 & 0x3F) {
        case 60:
            if (!in.isReadable()) {
                return NOT_ENOUGH_INPUT;
            }
            length = in.readUnsignedByte();
            break;
        case 61:
            if (in.readableBytes() < 2) {
                return NOT_ENOUGH_INPUT;
            }
            length = in.readUnsignedShortLE();
            break;
        case 62:
            if (in.readableBytes() < 3) {
                return NOT_ENOUGH_INPUT;
            }
            length = in.readUnsignedMediumLE();
            break;
        case 63:
            if (in.readableBytes() < 4) {
                return NOT_ENOUGH_INPUT;
            }
            length = in.readIntLE();
            break;
        default:
            length = tag >> 2 & 0x3F;
        }
        length += 1;

        if (in.readableBytes() < length) {
            in.resetReaderIndex();
            return NOT_ENOUGH_INPUT;
        }

        out.writeBytes(in, length);
        return length;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free