public class BitInputStream extends Object implements Closeable
| Constructor and Description |
|---|
BitInputStream(InputStream in,
ByteOrder byteOrder)
Constructor taking an InputStream and its bit arrangement.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBitCache()
Clears the cache of bits that have been read from the
underlying stream but not yet provided via
readBits(int). |
void |
close() |
long |
readBits(int count)
Returns at most 63 bits read from the underlying stream.
|
public BitInputStream(InputStream in, ByteOrder byteOrder)
in - the InputStreambyteOrder - the bit arrangement across byte boundaries,
either BIG_ENDIAN (aaaaabbb bb000000) or LITTLE_ENDIAN (bbbaaaaa 000000bb)public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void clearBitCache()
readBits(int).public long readBits(int count) throws IOException
count - the number of bits to read, must be a positive
number not bigger than 63.IOException - on errorCopyright © 2016 The Apache Software Foundation. All rights reserved.