Class BitReader
java.lang.Object
org.brotli.dec.BitReader
Bit reading helpers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int(package private) static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final int(package private) static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void(package private) static voidbytesToNibbles(State s, int byteLen) Translates bytes to halves (int/short).(package private) static intcheckHealth(State s, int endOfStream) (package private) static intcopyRawBytes(State s, byte[] data, int offset, int length) (package private) static void(package private) static void(package private) static int(package private) static int(package private) static int(package private) static intprivate static int(package private) static int(package private) static intreadFewBits(State s, int n) Fetches bits from accumulator.private static intreadManyBits(State s, int n) (package private) static intFills up the input buffer.(package private) static int
-
Field Details
-
LOG_BITNESS
private static final int LOG_BITNESS -
BIT_READER_DEBUG
private static final int BIT_READER_DEBUG -
BITNESS
static final int BITNESS -
BYTENESS
private static final int BYTENESS -
CAPACITY
private static final int CAPACITY- See Also:
-
SLACK
private static final int SLACK- See Also:
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
SAFEGUARD
private static final int SAFEGUARD- See Also:
-
WATERLINE
private static final int WATERLINE- See Also:
-
HALF_BITNESS
private static final int HALF_BITNESS -
HALF_SIZE
private static final int HALF_SIZE -
HALVES_CAPACITY
private static final int HALVES_CAPACITY -
HALF_BUFFER_SIZE
private static final int HALF_BUFFER_SIZE -
LOG_HALF_SIZE
private static final int LOG_HALF_SIZE -
HALF_WATERLINE
static final int HALF_WATERLINE
-
-
Constructor Details
-
BitReader
BitReader()
-
-
Method Details
-
readMoreInput
Fills up the input buffer.Should not be called if there are at least 36 bytes present after current position.
After encountering the end of the input stream, 64 additional zero bytes are copied to the buffer.
-
checkHealth
-
assertAccumulatorHealthy
-
fillBitWindow
-
doFillBitWindow
-
peekBits
-
readFewBits
Fetches bits from accumulator. WARNING: accumulator MUST contain at least the specified amount of bits, otherwise BitReader will become broken. -
readBits
-
readManyBits
-
initBitReader
-
prepare
-
reload
-
jumpToByteBoundary
-
halfAvailable
-
copyRawBytes
-
bytesToNibbles
Translates bytes to halves (int/short).
-