Class BitStream
- java.lang.Object
-
- org.apache.commons.compress.utils.BitInputStream
-
- org.apache.commons.compress.archivers.zip.BitStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.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 Summary
Constructors Constructor Description BitStream(java.io.InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
nextBit()
Returns the next bit.(package private) long
nextBits(int n)
Returns the integer value formed by the n next bits (up to 8 bits).(package private) int
nextByte()
-
Methods inherited from class org.apache.commons.compress.utils.BitInputStream
alignWithByteBoundary, bitsAvailable, bitsCached, clearBitCache, close, getBytesRead, readBits
-
-
-
-
Method Detail
-
nextBit
int nextBit() throws java.io.IOException
Returns the next bit.- Returns:
- The next bit (0 or 1) or -1 if the end of the stream has been reached
- Throws:
java.io.IOException
-
nextBits
long nextBits(int n) throws java.io.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:
java.io.IOException
-
nextByte
int nextByte() throws java.io.IOException
- Throws:
java.io.IOException
-
-