public class BitInputStream extends java.io.InputStream implements BitConstants
Warning: The read(byte[]) and read(byte[], int, int)
methods of InputStream will not work appropriately with any
bit size > 8 bits.
BIT_MASKS| Constructor and Description |
|---|
BitInputStream(java.io.InputStream is,
int startingNumberOfBits)
Create a BitInputStream wrapping the given
InputStream
and reading the number of bits specified. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRemainingBitsOfData()
When shifting from buffer to buffer, the input stream also should be reset.
|
int |
getBitMask()
Answer with the current bit mask for the current bit size.
|
void |
increaseRequestedNumberOfBits()
Increase the requested number of bits by one.
|
int |
read()
Read a number of bits off of the wrapped InputStream.
|
void |
setRequestedNumberOfBits(int numberOfBits)
Set the number of bits to be read with each call to
read(). |
public BitInputStream(java.io.InputStream is,
int startingNumberOfBits)
InputStream
and reading the number of bits specified.public void setRequestedNumberOfBits(int numberOfBits)
read().public void increaseRequestedNumberOfBits()
public int getBitMask()
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void clearRemainingBitsOfData()