Package org.brotli.dec
Class BitReader
- java.lang.Object
-
- org.brotli.dec.BitReader
-
final class BitReader extends java.lang.ObjectBit reading helpers.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intBITNESSprivate static intBUFFER_SIZEprivate static intBYTENESSprivate static intCAPACITYprivate static intDEBUGprivate static intHALF_BITNESSprivate static intHALF_BUFFER_SIZEprivate static intHALF_SIZEprivate static intHALF_WATERLINEprivate static intHALVES_CAPACITYprivate static intLOG_BITNESSprivate static intLOG_HALF_SIZEprivate static intSAFEGUARDprivate static intSLACKprivate static intWATERLINE
-
Constructor Summary
Constructors Constructor Description BitReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidassertAccumulatorHealthy(State s)(package private) static voidbytesToNibbles(State s, int byteLen)Translates bytes to halves (int/short).(package private) static voidcheckHealth(State s, int endOfStream)(package private) static voidcopyRawBytes(State s, byte[] data, int offset, int length)(package private) static voiddoFillBitWindow(State s)(package private) static voiddoReadMoreInput(State s)(package private) static voidfillBitWindow(State s)(package private) static inthalfAvailable(State s)(package private) static voidinitBitReader(State s)(package private) static voidjumpToByteBoundary(State s)(package private) static intpeekBits(State s)private static voidprepare(State s)(package private) static intreadBits(State s, int n)(package private) static intreadFewBits(State s, int n)Fetches bits from accumulator.private static intreadManyBits(State s, int n)(package private) static voidreadMoreInput(State s)Fills up the input buffer.(package private) static voidreload(State s)
-
-
-
Field Detail
-
LOG_BITNESS
private static final int LOG_BITNESS
-
DEBUG
private static final int DEBUG
-
BITNESS
static final int BITNESS
-
BYTENESS
private static final int BYTENESS
-
CAPACITY
private static final int CAPACITY
- See Also:
- Constant Field Values
-
SLACK
private static final int SLACK
- See Also:
- Constant Field Values
-
BUFFER_SIZE
private static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
SAFEGUARD
private static final int SAFEGUARD
- See Also:
- Constant Field Values
-
WATERLINE
private static final int WATERLINE
- See Also:
- Constant Field Values
-
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
-
HALF_WATERLINE
private static final int HALF_WATERLINE
-
LOG_HALF_SIZE
private static final int LOG_HALF_SIZE
-
-
Method Detail
-
readMoreInput
static void readMoreInput(State s)
Fills up the input buffer.No-op 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.
-
doReadMoreInput
static void doReadMoreInput(State s)
-
checkHealth
static void checkHealth(State s, int endOfStream)
-
assertAccumulatorHealthy
static void assertAccumulatorHealthy(State s)
-
fillBitWindow
static void fillBitWindow(State s)
-
doFillBitWindow
static void doFillBitWindow(State s)
-
peekBits
static int peekBits(State s)
-
readFewBits
static int readFewBits(State s, int n)
Fetches bits from accumulator. WARNING: accumulator MUST contain at least the specified amount of bits, otherwise BitReader will become broken.
-
readBits
static int readBits(State s, int n)
-
readManyBits
private static int readManyBits(State s, int n)
-
initBitReader
static void initBitReader(State s)
-
prepare
private static void prepare(State s)
-
reload
static void reload(State s)
-
jumpToByteBoundary
static void jumpToByteBoundary(State s)
-
halfAvailable
static int halfAvailable(State s)
-
copyRawBytes
static void copyRawBytes(State s, byte[] data, int offset, int length)
-
bytesToNibbles
static void bytesToNibbles(State s, int byteLen)
Translates bytes to halves (int/short).
-
-