| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private int | |
| private final ByteOrder | |
| private final CountingInputStream | |
| private static final long[] | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | BitInputStream(final InputStream
the InputStream in, final ByteOrder the bit arrangement across byte boundaries, either BIG_ENDIAN (aaaaabbb bb000000) or LITTLE_ENDIAN (bbbaaaaa 000000bb) byteOrder)Constructor taking an InputStream and its bit arrangement. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public long | Returns: estimate of the number of bits that can be read without blockingReturns an estimate of the number of bits that can be read from this input stream without blocking by the next invocation of a method for this input stream. |
| public int | Returns: estimate of the number of bits that can be read without reading from the underlying streamReturns the number of bits that can be read from this input stream without reading from the underlying input stream at all. |
| public void | clearBitCache()
Clears the cache of bits that have been read from the underlying stream but not yet provided via |
| public void | close()
Implements java. |
| private boolean | |
| public long | Returns: the number of bytes read from the underlying streamReturns the number of bytes read from the underlying stream. |
| private long | |
| public long | Returns: the bits concatenated as a long using the stream's byte order. -1 if the end of the underlying stream has been reached before reading the requested number of bitsthe number of bits to read, must be a positive number not bigger than 63. count)Returns at most 63 bits read from the underlying stream. |
| private long |
| bitsCached | back to summary |
|---|---|
| private long bitsCached | |
| bitsCachedSize | back to summary |
|---|---|
| private int bitsCachedSize | |
| byteOrder | back to summary |
|---|---|
| private final ByteOrder byteOrder | |
| in | back to summary |
|---|---|
| private final CountingInputStream in | |
| MASKS | back to summary |
|---|---|
| private static final long[] MASKS | |
| MAXIMUM_CACHE_SIZE | back to summary |
|---|---|
| private static final int MAXIMUM_CACHE_SIZE | |
| BitInputStream | back to summary |
|---|---|
| public BitInputStream(final InputStream in, final ByteOrder byteOrder) Constructor taking an InputStream and its bit arrangement.
| |
| alignWithByteBoundary | back to summary |
|---|---|
| public void alignWithByteBoundary() Drops bits until the next bits will be read from a byte boundary.
| |
| bitsAvailable | back to summary |
|---|---|
| public long bitsAvailable() throws IOException Returns an estimate of the number of bits that can be read from this input stream without blocking by the next invocation of a method for this input stream.
| |
| bitsCached | back to summary |
|---|---|
| public int bitsCached() Returns the number of bits that can be read from this input stream without reading from the underlying input stream at all.
| |
| clearBitCache | back to summary |
|---|---|
| public void clearBitCache() Clears the cache of bits that have been read from the underlying stream but not yet provided via | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| ensureCache | back to summary |
|---|---|
| private boolean ensureCache(final int count) throws IOException Fills the cache up to 56 bits
| |
| getBytesRead | back to summary |
|---|---|
| public long getBytesRead() Returns the number of bytes read from the underlying stream. This includes the bytes read to fill the current cache and not read as bits so far.
| |
| processBitsGreater57 | back to summary |
|---|---|
| private long processBitsGreater57(final int count) throws IOException | |
| readBits | back to summary |
|---|---|
| public long readBits(final int count) throws IOException Returns at most 63 bits read from the underlying stream.
| |
| readCachedBits | back to summary |
|---|---|
| private long readCachedBits(final int count) | |