Class BitReader

java.lang.Object
org.brotli.dec.BitReader

final class BitReader extends Object
Bit reading helpers.
  • 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

      static int readMoreInput(State s)
      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

      static int 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 int initBitReader(State s)
    • prepare

      private static int prepare(State s)
    • reload

      static int reload(State s)
    • jumpToByteBoundary

      static int jumpToByteBoundary(State s)
    • halfAvailable

      static int halfAvailable(State s)
    • copyRawBytes

      static int copyRawBytes(State s, byte[] data, int offset, int length)
    • bytesToNibbles

      static void bytesToNibbles(State s, int byteLen)
      Translates bytes to halves (int/short).