Interface BitReader

  • All Known Implementing Classes:
    BitInputStream

    public interface BitReader
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean bit()
      Read one bit.
      long nrBits()
      Returns the number of bits that have been read from this bitreader.
      boolean pad​(int width)
      Check that the rest of the block has been padded with zeros.
      int read​(int width)
      Read some bits.
    • Method Detail

      • nrBits

        long nrBits()
        Returns the number of bits that have been read from this bitreader.
        Returns:
        The number of bits read so far.
      • pad

        boolean pad​(int width)
             throws IOException
        Check that the rest of the block has been padded with zeros.
        Parameters:
        width - The size in bits of the block to pad. This will typically be 8, 16, 32, 64, 128, 256, etc.
        Returns:
        true if the block was zero padded, or false if the the padding contained any one bits.
        Throws:
        IOException
      • read

        int read​(int width)
          throws IOException
        Read some bits.
        Parameters:
        width - The number of bits to read. (0..32)
        Returns:
        the bits
        Throws:
        IOException