| |
|
| java.lang.Object jj2000.j2k.codestream.reader.PktHeaderBitReader
PktHeaderBitReader | class PktHeaderBitReader (Code) | | This class provides a bit based reading facility from a byte based one,
applying the bit unstuffing procedure as required by the packet headers.
|
Method Summary | |
final int | readBit() Reads a single bit from the input. | final int | readBits(int n) Reads a specified number of bits and returns them in a single
integer. | void | setInput(RandomAccessIO in) Sets the underlying byte based input to the given object. | void | setInput(ByteArrayInputStream bais) Sets the underlying byte based input to the given object. | void | sync() Synchronizes this object with the underlying byte based input. |
bais | ByteArrayInputStream bais(Code) | | The byte array that is the source of data if the PktHeaderBitReader
is instantiated with a buffer instead of a RandomAccessIO
|
bbuf | int bbuf(Code) | | The current bit buffer
|
bpos | int bpos(Code) | | The position of the next bit to read in the bit buffer (0 means
empty, 8 full)
|
nextbbuf | int nextbbuf(Code) | | The next bit buffer, if bit stuffing occurred (i.e. current bit
buffer holds 0xFF)
|
usebais | boolean usebais(Code) | | Flag indicating whether the data should be read from the buffer
|
PktHeaderBitReader | PktHeaderBitReader(RandomAccessIO in)(Code) | | Instantiates a 'PktHeaderBitReader' that gets the byte data from the
given source.
Parameters: in - The source of byte data |
PktHeaderBitReader | PktHeaderBitReader(ByteArrayInputStream bais)(Code) | | Instantiates a 'PktHeaderBitReader' that gets the byte data from the
given source.
Parameters: bais - The source of byte data |
readBit | final int readBit() throws IOException(Code) | | Reads a single bit from the input.
The read bit (0 or 1) exception: IOException - If an I/O error occurred exception: EOFException - If teh end of file has been reached |
readBits | final int readBits(int n) throws IOException(Code) | | Reads a specified number of bits and returns them in a single
integer. The bits are returned in the 'n' least significant bits of the
returned integer. The maximum number of bits that can be read is 31.
Parameters: n - The number of bits to read The read bits, packed in the 'n' LSBs. exception: IOException - If an I/O error occurred exception: EOFException - If teh end of file has been reached |
setInput | void setInput(RandomAccessIO in)(Code) | | Sets the underlying byte based input to the given object. This method
discards any currently buffered bits and gets ready to start reading
bits from 'in'.
This method is equivalent to creating a new 'PktHeaderBitReader'
object.
Parameters: in - The source of byte data |
setInput | void setInput(ByteArrayInputStream bais)(Code) | | Sets the underlying byte based input to the given object. This method
discards any currently buffered bits and gets ready to start reading
bits from 'in'.
This method is equivalent to creating a new 'PktHeaderBitReader'
object.
Parameters: bais - The source of byte data |
sync | void sync()(Code) | | Synchronizes this object with the underlying byte based input. It
discards and buffered bits and gets ready to read bits from the current
position in the underlying byte based input.
This method should always be called when some data has been read
directly from the underlying byte based input since the last call to
'readBits()' or 'readBit()' before a new call to any of those methods.
|
|
|
|