|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kc7bfi.jflac.io.BitInputStream
public class BitInputStream
Bit-wide input stream.
Constructor Summary | |
---|---|
BitInputStream(InputStream is)
The constructor. |
Method Summary | |
---|---|
int |
bitsLeftForByteAlignment()
return the number of bits to read to align the byte. |
int |
getInputBytesUnconsumed()
return the number of bytes left to read. |
short |
getReadCRC16()
return the read CRC-16 value. |
int |
getTotalBytesRead()
Total Blurbs read. |
boolean |
isConsumedByteAligned()
Test if the Bit Stream consumed bits is byte aligned. |
int |
peekBitToInt(int val,
int bit)
peek at the next bit and add it to the input integer. |
int |
peekRawUInt(int bits)
peek at bits into an unsigned integer without advancing the input stream. |
int |
readBit()
read a single bit. |
int |
readBitToInt(int val)
read a bit into an integer value. |
long |
readBitToLong(long val)
read a bit into a long value. |
void |
readByteBlockAlignedNoCRC(byte[] val,
int nvals)
Read a block of bytes (aligned) without updating the CRC value. |
int |
readRawInt(int bits)
read bits into a signed integer. |
int |
readRawIntLittleEndian()
read bits into an unsigned little endian integer. |
int |
readRawUInt(int bits)
read bits into an unsigned integer. |
long |
readRawULong(int bits)
read bits into an unsigned long. |
void |
readRiceSignedBlock(int[] vals,
int pos,
int nvals,
int parameter)
Read a Rice Signal Block. |
int |
readUnaryUnsigned()
Read and count the number of zero bits. |
int |
readUTF8Int(ByteData raw)
read UTF8 integer. |
long |
readUTF8Long(ByteData raw)
read UTF long. |
void |
reset()
Reset the bit stream. |
void |
resetReadCRC16(short seed)
Reset the read CRC-16 value. |
void |
skipBitsNoCRC(int bits)
skip over bits in bit stream without updating CRC. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitInputStream(InputStream is)
is
- The InputStream to read bits fromMethod Detail |
---|
public void reset()
public void resetReadCRC16(short seed)
seed
- The initial CRC-16 valuepublic short getReadCRC16()
public boolean isConsumedByteAligned()
public int bitsLeftForByteAlignment()
public int getInputBytesUnconsumed()
public void skipBitsNoCRC(int bits) throws IOException
bits
- Number of bits to skip
IOException
- Thrown if error reading from input streampublic int readBit() throws IOException
IOException
- Thrown if error reading input streampublic int readBitToInt(int val) throws IOException
val
- The integer to shift and add read bit
IOException
- Thrown if error reading input streampublic int peekBitToInt(int val, int bit) throws IOException
val
- The input integerbit
- The bit to peek at
IOException
- Thrown if error reading input streampublic long readBitToLong(long val) throws IOException
val
- The long to shift and add read bit
IOException
- Thrown if error reading input streampublic int readRawUInt(int bits) throws IOException
bits
- The number of bits to read
IOException
- Thrown if error reading input streampublic int peekRawUInt(int bits) throws IOException
bits
- The number of bits to read
IOException
- Thrown if error reading input streampublic int readRawInt(int bits) throws IOException
bits
- The number of bits to read
IOException
- Thrown if error reading input streampublic long readRawULong(int bits) throws IOException
bits
- The number of bits to read
IOException
- Thrown if error reading input streampublic int readRawIntLittleEndian() throws IOException
IOException
- Thrown if error reading input streampublic void readByteBlockAlignedNoCRC(byte[] val, int nvals) throws IOException
val
- The array to receive the bytes. If null, no bytes are returnednvals
- The number of bytes to read
IOException
- Thrown if error reading input streampublic int readUnaryUnsigned() throws IOException
IOException
- Thrown if error reading input streampublic void readRiceSignedBlock(int[] vals, int pos, int nvals, int parameter) throws IOException
vals
- The values to be returnedpos
- The starting position in the vals arraynvals
- The number of values to returnparameter
- The Rice parameter
IOException
- On read errorpublic int readUTF8Int(ByteData raw) throws IOException
raw
- The raw bytes read (output). If null, no bytes are returned
IOException
- Thrown if error reading input streampublic long readUTF8Long(ByteData raw) throws IOException
raw
- The raw bytes read (output). If null, no bytes are returned
IOException
- Thrown if error reading input streampublic int getTotalBytesRead()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |