Package org.brotli.dec
Class Transform
- java.lang.Object
-
- org.brotli.dec.Transform
-
final class Transform extends java.lang.Object
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 Modifier and Type Class Description (package private) static class
Transform.Transforms
-
Field Summary
Fields Modifier and Type Field Description private static int
IDENTITY
(package private) static int
NUM_RFC_TRANSFORMS
private static int
OMIT_FIRST_BASE
private static int
OMIT_FIRST_LAST_LIMIT
private static int
OMIT_LAST_BASE
private static java.lang.String
PREFIX_SUFFIX_SRC
(package private) static Transform.Transforms
RFC_TRANSFORMS
private static int
SHIFT_ALL
private static int
SHIFT_FIRST
private static java.lang.String
TRANSFORMS_SRC
private static int
UPPERCASE_ALL
private static int
UPPERCASE_FIRST
-
Constructor Summary
Constructors Constructor Description Transform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
transformDictionaryWord(byte[] dst, int dstOffset, java.nio.ByteBuffer src, int srcOffset, int len, Transform.Transforms transforms, int transformIndex)
private static void
unpackTransforms(byte[] prefixSuffix, int[] prefixSuffixHeads, int[] transforms, java.lang.String prefixSuffixSrc, java.lang.String transformsSrc)
-
-
-
Field Detail
-
NUM_RFC_TRANSFORMS
static final int NUM_RFC_TRANSFORMS
- See Also:
- Constant Field Values
-
RFC_TRANSFORMS
static final Transform.Transforms RFC_TRANSFORMS
-
OMIT_FIRST_LAST_LIMIT
private static final int OMIT_FIRST_LAST_LIMIT
- See Also:
- Constant Field Values
-
IDENTITY
private static final int IDENTITY
- See Also:
- Constant Field Values
-
OMIT_LAST_BASE
private static final int OMIT_LAST_BASE
- See Also:
- Constant Field Values
-
UPPERCASE_FIRST
private static final int UPPERCASE_FIRST
- See Also:
- Constant Field Values
-
UPPERCASE_ALL
private static final int UPPERCASE_ALL
- See Also:
- Constant Field Values
-
OMIT_FIRST_BASE
private static final int OMIT_FIRST_BASE
- See Also:
- Constant Field Values
-
SHIFT_FIRST
private static final int SHIFT_FIRST
- See Also:
- Constant Field Values
-
SHIFT_ALL
private static final int SHIFT_ALL
- See Also:
- Constant Field Values
-
PREFIX_SUFFIX_SRC
private static final java.lang.String PREFIX_SUFFIX_SRC
- See Also:
- Constant Field Values
-
TRANSFORMS_SRC
private static final java.lang.String TRANSFORMS_SRC
- See Also:
- Constant Field Values
-
-
Method Detail
-
unpackTransforms
private static void unpackTransforms(byte[] prefixSuffix, int[] prefixSuffixHeads, int[] transforms, java.lang.String prefixSuffixSrc, java.lang.String transformsSrc)
-
transformDictionaryWord
static int transformDictionaryWord(byte[] dst, int dstOffset, java.nio.ByteBuffer src, int srcOffset, int len, Transform.Transforms transforms, int transformIndex)
-
-