java.lang.Object
org.apache.commons.compress.utils.BitInputStream
org.apache.commons.compress.archivers.zip.BitStream
All Implemented Interfaces:
Closeable, AutoCloseable

class BitStream extends BitInputStream
Iterates over the bits of an InputStream. For each byte the bits are read from the right to the left.
Since:
1.7
  • Constructor Details

  • Method Details

    • nextBit

      int nextBit() throws IOException
      Returns the next bit.
      Returns:
      The next bit (0 or 1) or -1 if the end of the stream has been reached
      Throws:
      IOException
    • nextBits

      long nextBits(int n) throws IOException
      Returns the integer value formed by the n next bits (up to 8 bits).
      Parameters:
      n - the number of bits read (up to 8)
      Returns:
      The value formed by the n bits, or -1 if the end of the stream has been reached
      Throws:
      IOException
    • nextByte

      int nextByte() throws IOException
      Throws:
      IOException