public class RawDecoder extends java.lang.Object implements Decoder
Modifier and Type | Field and Description |
---|---|
private boolean |
foundFF
Flag used to know if a byte with a value of 0xFF has been found.
|
private CPByteStream |
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 and Description |
---|
RawDecoder()
Constructor that does not initializes nothing.
|
RawDecoder(CPByteStream inputByteStream)
Constructor that initializes the internal registers and outputByteStream.
|
Modifier and Type | Method and Description |
---|---|
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(CPByteStream inputByteStream)
Swaps the current inputByteStream.
|
private CPByteStream 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.
public RawDecoder()
public RawDecoder(CPByteStream inputByteStream) throws ErrorException
inputByteStream
- the input stream of bytesErrorException
- when end of ByteStream is reachedpublic boolean decodeBit() throws ErrorException
public boolean decodeBit(int context) throws ErrorException
public void swapInputByteStream(CPByteStream inputByteStream)
swapInputByteStream
in interface Decoder
inputByteStream
- the input stream of bytespublic void restart() throws ErrorException
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)