|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.entropy.decoder.ByteToBitInput
This class provides an adapter to perform bit based input on byte based output obejcts that inherit from a 'ByteInputBuffer' class. This class also performs the bit unstuffing procedure specified for the 'selective arithmetic coding bypass' mode of the JPEG 2000 entropy coder.
Field Summary | |
(package private) int |
bbuf
The bit buffer |
(package private) int |
bpos
The position of the next bit to get from the byte buffer. |
(package private) ByteInputBuffer |
in
The byte based input |
Constructor Summary | |
ByteToBitInput(ByteInputBuffer in)
Instantiates a new 'ByteToBitInput' object that uses 'in' as the underlying byte based input. |
Method Summary | |
boolean |
checkBytePadding()
Checks for past errors in the decoding process by verifying the byte padding with an alternating sequence of 0's and 1's. |
(package private) void |
flush()
Flushes (i.e. |
int |
readBit()
Reads from the bit stream one bit. |
(package private) void |
setByteArray(byte[] buf,
int off,
int len)
Resets the underlying byte input to start a new segment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
ByteInputBuffer in
int bbuf
int bpos
Constructor Detail |
public ByteToBitInput(ByteInputBuffer in)
in
- The underlying byte based input.Method Detail |
public final int readBit()
public boolean checkBytePadding()
final void flush()
final void setByteArray(byte[] buf, int off, int len)
buf
- The byte array containing the byte data. If null the
current byte array is assumed.off
- The index of the first element in 'buf' to be decoded. If
negative the byte just after the previous segment is assumed, only
valid if 'buf' is null.len
- The number of bytes in 'buf' to be decoded. Any subsequent
bytes are taken to be 0xFF.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |