public class BitwiseInputStream extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BitwiseInputStream.AccessException
An exception to report access problems.
|
Constructor and Description |
---|
BitwiseInputStream(byte[] buf)
Create object from byte array.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Return the number of bit still available for reading.
|
int |
read(int bits)
Read some data and increment the current position.
|
byte[] |
readByteArray(int bits)
Read data in bulk into a byte array and increment the current position.
|
void |
skip(int bits)
Increment the current position and ignore contained data.
|
public BitwiseInputStream(byte[] buf)
buf
- a byte array containing datapublic int available()
public int read(int bits) throws BitwiseInputStream.AccessException
bits
- the amount of data to read (gte 0, lte 8)BitwiseInputStream.AccessException
public byte[] readByteArray(int bits) throws BitwiseInputStream.AccessException
bits
- the amount of data to readBitwiseInputStream.AccessException
public void skip(int bits) throws BitwiseInputStream.AccessException
bits
- the amount by which to increment the positionBitwiseInputStream.AccessException