Home / Function/ encodeLiteral() — netty Function Reference

encodeLiteral() — netty Function Reference

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

Function java Buffer Allocators calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  a68ad8f3_8ce4_d2df_f94a_c25a5795c393["encodeLiteral()"]
  6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8["Snappy"]
  a68ad8f3_8ce4_d2df_f94a_c25a5795c393 -->|defined in| 6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8
  2c81d28d_4011_0232_9bac_669b46d6eed3["encode()"]
  2c81d28d_4011_0232_9bac_669b46d6eed3 -->|calls| a68ad8f3_8ce4_d2df_f94a_c25a5795c393
  9bc0c49d_4e6c_a79d_a266_e9fdc2d4143e["bitsToEncode()"]
  a68ad8f3_8ce4_d2df_f94a_c25a5795c393 -->|calls| 9bc0c49d_4e6c_a79d_a266_e9fdc2d4143e
  style a68ad8f3_8ce4_d2df_f94a_c25a5795c393 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java lines 268–281

    static void encodeLiteral(ByteBuf in, ByteBuf out, int length) {
        if (length < 61) {
            out.writeByte(length - 1 << 2);
        } else {
            int bitLength = bitsToEncode(length - 1);
            int bytesToEncode = 1 + bitLength / 8;
            out.writeByte(59 + bytesToEncode << 2);
            for (int i = 0; i < bytesToEncode; i++) {
                out.writeByte(length - 1 >> i * 8 & 0x0ff);
            }
        }

        out.writeBytes(in, length);
    }

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free