Constructor and Description |
---|
BitInputStream(Stream in)
Make a BitReader from an InputStream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
bit()
Read one bit.
|
long |
nrBits()
Get the number of bits that have been read from this BitInputStream.
|
boolean |
pad(int width)
Check that the rest of the block has been padded with zeroes.
|
int |
read(int width)
Read some bits.
|
public BitInputStream(Stream in)
in
- An InputStream.public boolean bit() throws IOException
bit
in interface BitReader
IOException
public long nrBits()
public boolean pad(int width) throws IOException
pad
in interface BitReader
width
- The size of the block to pad in bits.
This will typically be 8, 16, 32, 64, 128, 256, etc.IOException
public int read(int width) throws IOException
read
in interface BitReader
width
- The number of bits to read. (0..32)IOException