Package org.brotli.dec
Class Transform
java.lang.Object
org.brotli.dec.Transform
Transformations on dictionary words.
Transform descriptor is a triplet: {prefix, operator, suffix}.
"prefix" and "suffix" are short strings inserted before and after transformed dictionary word.
"operator" is applied to dictionary word itself.
Some operators has "built-in" parameters, i.e. parameter is defined by operator ordinal. Other
operators have "external" parameters, supplied via additional table encoded in shared dictionary.
Operators:
- IDENTITY (0): dictionary word is inserted "as is"
- OMIT_LAST_N (1 - 9): last N octets of dictionary word are not inserted; N == ordinal
- OMIT_FIRST_M (12-20): first M octets of dictionary word are not inserted; M == ordinal - 11
- UPPERCASE_FIRST (10): first "scalar" is XOR'ed with number 32
- UPPERCASE_ALL (11): all "scalars" are XOR'ed with number 32
- SHIFT_FIRST (21): first "scalar" is shifted by number form parameter table
- SHIFT_ALL (22): all "scalar" is shifted by number form parameter table
Here "scalar" is a variable length character coding similar to UTF-8 encoding.
UPPERCASE_XXX / SHIFT_XXX operators were designed to change the case of UTF-8 encoded characters.
While UPPERCASE_XXX works well only on ASCII charset, SHIFT is much more generic and could be
used for most (all?) alphabets.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
(package private) static final int
private static final int
private static final int
private static final int
private static final String
(package private) static final Transform.Transforms
private static final int
private static final int
private static final String
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static int
transformDictionaryWord
(byte[] dst, int dstOffset, ByteBuffer src, int srcOffset, int len, Transform.Transforms transforms, int transformIndex) private static void
unpackTransforms
(byte[] prefixSuffix, int[] prefixSuffixHeads, int[] transforms, String prefixSuffixSrc, String transformsSrc)
-
Field Details
-
NUM_RFC_TRANSFORMS
static final int NUM_RFC_TRANSFORMS- See Also:
-
RFC_TRANSFORMS
-
OMIT_FIRST_LAST_LIMIT
private static final int OMIT_FIRST_LAST_LIMIT- See Also:
-
IDENTITY
private static final int IDENTITY- See Also:
-
OMIT_LAST_BASE
private static final int OMIT_LAST_BASE- See Also:
-
UPPERCASE_FIRST
private static final int UPPERCASE_FIRST- See Also:
-
UPPERCASE_ALL
private static final int UPPERCASE_ALL- See Also:
-
OMIT_FIRST_BASE
private static final int OMIT_FIRST_BASE- See Also:
-
SHIFT_FIRST
private static final int SHIFT_FIRST- See Also:
-
SHIFT_ALL
private static final int SHIFT_ALL- See Also:
-
PREFIX_SUFFIX_SRC
- See Also:
-
TRANSFORMS_SRC
- See Also:
-
-
Constructor Details
-
Transform
Transform()
-
-
Method Details
-
unpackTransforms
-
transformDictionaryWord
static int transformDictionaryWord(byte[] dst, int dstOffset, ByteBuffer src, int srcOffset, int len, Transform.Transforms transforms, int transformIndex)
-