Home / Class/ Lz4Constants Class — netty Architecture

Lz4Constants Class — netty Architecture

Architecture documentation for the Lz4Constants class in Lz4Constants.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f188dd2a_828d_ec58_416d_523935fe6ca6["Lz4Constants"]
  df5102e4_511d_dbf1_1fc9_c582f80e9678["Lz4Constants.java"]
  f188dd2a_828d_ec58_416d_523935fe6ca6 -->|defined in| df5102e4_511d_dbf1_1fc9_c582f80e9678
  4fb54e58_0a2b_7c52_8cc8_1f812b0ac311["Lz4Constants()"]
  f188dd2a_828d_ec58_416d_523935fe6ca6 -->|method| 4fb54e58_0a2b_7c52_8cc8_1f812b0ac311

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Lz4Constants.java lines 18–73

final class Lz4Constants {
    /**
     * Magic number of LZ4 block.
     */
    static final long MAGIC_NUMBER = (long) 'L' << 56 |
                                     (long) 'Z' << 48 |
                                     (long) '4' << 40 |
                                     (long) 'B' << 32 |
                                            'l' << 24 |
                                            'o' << 16 |
                                            'c' << 8  |
                                            'k';

    /**
     * Full length of LZ4 block header.
     */
    static final int HEADER_LENGTH = 8 +  // magic number
                                     1 +  // token
                                     4 +  // compressed length
                                     4 +  // decompressed length
                                     4;   // checksum

    /**
     * Offsets of header's parts.
     */
    static final int TOKEN_OFFSET = 8;

    static final int COMPRESSED_LENGTH_OFFSET = TOKEN_OFFSET + 1;
    static final int DECOMPRESSED_LENGTH_OFFSET = COMPRESSED_LENGTH_OFFSET + 4;
    static final int CHECKSUM_OFFSET = DECOMPRESSED_LENGTH_OFFSET + 4;

    /**
     * Base value for compression level.
     */
    static final int COMPRESSION_LEVEL_BASE = 10;

    /**
     * LZ4 block sizes.
     */
    static final int MIN_BLOCK_SIZE = 64;
    static final int MAX_BLOCK_SIZE = 1 << COMPRESSION_LEVEL_BASE + 0x0F;   //  32 M
    static final int DEFAULT_BLOCK_SIZE = 1 << 16;  // 64 KB

    /**
     * LZ4 block types.
     */
    static final int BLOCK_TYPE_NON_COMPRESSED = 0x10;
    static final int BLOCK_TYPE_COMPRESSED = 0x20;

    /**
     * Default seed value for xxhash.
     */
    static final int DEFAULT_SEED = 0x9747b28c;

    private Lz4Constants() { }
}

Frequently Asked Questions

What is the Lz4Constants class?
Lz4Constants is a class in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Lz4Constants.java.
Where is Lz4Constants defined?
Lz4Constants is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Lz4Constants.java at line 18.

Analyze Your Own Codebase

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

Try Supermodel Free