Top Description Constructors Methods
org.apache.commons.compress.archivers.zip

pack-priv final Class BitStream

extends BitInputStream
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.ByteOrder, org.apache.commons.compress.utils.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

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

The next bit (0 or 1) or -1 if the end of the stream has been reached
nextBit
()

Returns the next bit.

pack-priv long

Returns:

The value formed by the n bits, or -1 if the end of the stream has been reached
nextBits
(final int
the number of bits read (up to 8)
n
)

Returns the integer value formed by the n next bits (up to 8 bits).

pack-priv int
Inherited from org.apache.commons.compress.utils.BitInputStream:
alignWithByteBoundarybitsAvailablebitsCachedclearBitCacheclosegetBytesReadreadBits

Constructor Detail

BitStreamback to summary
pack-priv BitStream(final InputStream in)

Method Detail

nextBitback to summary
pack-priv int nextBit() throws IOException

Returns the next bit.

Returns:int

The next bit (0 or 1) or -1 if the end of the stream has been reached

Exceptions
IOException:
on error.
nextBitsback to summary
pack-priv long nextBits(final int n) throws IOException

Returns the integer value formed by the n next bits (up to 8 bits).

Parameters
n:int

the number of bits read (up to 8)

Returns:long

The value formed by the n bits, or -1 if the end of the stream has been reached

Exceptions
IOException:
on error.
nextByteback to summary
pack-priv int nextByte() throws IOException