|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Common.LogicalTarget.JPEG2000.Decode.RawDecoder
public class RawDecoder
This class decodes bits from a compatible JPEG2000 codestream (without encoded with the MQ), i.e. when a byte 0xFF is found, the first bit of the following byte is skipped. This class could be used when encoding using the bypass mode of JPEG2000 or in other situations, for instance when decoding the packet headers. Usge example:
construct
decodeBit
decodeBit
swapInputByteStream
restart
decodeBit
decodeBit
...
| Field Summary | |
|---|---|
private boolean |
foundFF
Flag used to know if a byte with a value of 0xFF has been found. |
private ByteStream |
inputByteStream
Bytestream from which the MQ decoder reads data. |
private int |
L
Byte position to be read from the inputByteStream. |
private int |
t
Number of bits to transfer (down counter). |
private int |
Tr
Byte to transfer. |
| Constructor Summary | |
|---|---|
RawDecoder()
Constructor that does not initializes nothing. |
|
RawDecoder(ByteStream inputByteStream)
Constructor that initializes the internal registers and outputByteStream. |
|
| Method Summary | |
|---|---|
boolean |
decodeBit()
Decode a bit. |
boolean |
decodeBit(int context)
Decode a bit using some context. |
void |
reset()
For compatibility. |
void |
restart()
Fills the Tr register. |
void |
swapInputByteStream(ByteStream inputByteStream)
Swaps the current inputByteStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ByteStream inputByteStream
The content must be understood as a ByteStream.
private int t
Usually it is initialized to 8, then count down until 0.
private int Tr
Byte flushed to the outputByteStream.
private int L
Only positive values allowed. The first byte is 0.
private boolean foundFF
True when a 0xFF byte is found.
| Constructor Detail |
|---|
public RawDecoder()
public RawDecoder(ByteStream inputByteStream)
throws ErrorException
inputByteStream - the input stream of bytes
ErrorException - when end of ByteStream is reached| Method Detail |
|---|
public boolean decodeBit()
throws ErrorException
decodeBit in interface DecoderErrorException - when end of ByteStream is reached
public boolean decodeBit(int context)
throws ErrorException
decodeBit in interface Decodercontext - a byte that indicates the context of the decoded bit
ErrorException - when end of ByteStream is reachedpublic void swapInputByteStream(ByteStream inputByteStream)
swapInputByteStream in interface DecoderinputByteStream - the input stream of bytes
public void restart()
throws ErrorException
restart in interface DecoderErrorException - for compatibilitypublic void reset()
reset in interface Decoder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||