1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.compression;
17
18 final class Lz4Constants {
19
20
21
22 static final long MAGIC_NUMBER = (long) 'L' << 56 |
23 (long) 'Z' << 48 |
24 (long) '4' << 40 |
25 (long) 'B' << 32 |
26 'l' << 24 |
27 'o' << 16 |
28 'c' << 8 |
29 'k';
30
31
32
33
34 static final int HEADER_LENGTH = 8 +
35 1 +
36 4 +
37 4 +
38 4;
39
40
41
42
43 static final int TOKEN_OFFSET = 8;
44
45 static final int THREAD_POOL_DELAY_SECONDS = 10;
46
47 static final int COMPRESSED_LENGTH_OFFSET = TOKEN_OFFSET + 1;
48 static final int DECOMPRESSED_LENGTH_OFFSET = COMPRESSED_LENGTH_OFFSET + 4;
49 static final int CHECKSUM_OFFSET = DECOMPRESSED_LENGTH_OFFSET + 4;
50
51
52
53
54 static final int COMPRESSION_LEVEL_BASE = 10;
55
56
57
58
59 static final int MIN_BLOCK_SIZE = 64;
60 static final int MAX_BLOCK_SIZE = 1 << COMPRESSION_LEVEL_BASE + 0x0F;
61 static final int DEFAULT_BLOCK_SIZE = 1 << 16;
62
63
64
65
66 static final int BLOCK_TYPE_NON_COMPRESSED = 0x10;
67 static final int BLOCK_TYPE_COMPRESSED = 0x20;
68
69
70
71
72 static final int DEFAULT_SEED = 0x9747b28c;
73
74 private Lz4Constants() { }
75 }