Class MMRDecompressor.RunData
- java.lang.Object
-
- org.apache.pdfbox.jbig2.decoder.mmr.MMRDecompressor.RunData
-
- Enclosing class:
- MMRDecompressor
private final class MMRDecompressor.RunData extends java.lang.Object
A class encapsulating the compressed raw data.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
buffer
(package private) int
bufferBase
(package private) int
bufferTop
private static int
CODE_OFFSET
(package private) int
lastCode
(package private) int
lastOffset
private static int
MAX_RUN_DATA_BUFFER
private static int
MIN_RUN_DATA_BUFFER
(package private) int
offset
(package private) javax.imageio.stream.ImageInputStream
stream
Compressed data stream.
-
Constructor Summary
Constructors Constructor Description RunData(javax.imageio.stream.ImageInputStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
align()
Skip to next byteprivate void
fillBuffer(int byteOffset)
private MMRDecompressor.Code
uncompressGetCode(MMRDecompressor.Code[] table)
private MMRDecompressor.Code
uncompressGetCodeLittleEndian(MMRDecompressor.Code[] table)
private int
uncompressGetNextCodeLittleEndian()
Fill up the code word in little endian mode.
-
-
-
Field Detail
-
MAX_RUN_DATA_BUFFER
private static final int MAX_RUN_DATA_BUFFER
- See Also:
- Constant Field Values
-
MIN_RUN_DATA_BUFFER
private static final int MIN_RUN_DATA_BUFFER
- See Also:
- Constant Field Values
-
CODE_OFFSET
private static final int CODE_OFFSET
- See Also:
- Constant Field Values
-
stream
javax.imageio.stream.ImageInputStream stream
Compressed data stream.
-
offset
int offset
-
lastOffset
int lastOffset
-
lastCode
int lastCode
-
buffer
byte[] buffer
-
bufferBase
int bufferBase
-
bufferTop
int bufferTop
-
-
Method Detail
-
uncompressGetCode
private final MMRDecompressor.Code uncompressGetCode(MMRDecompressor.Code[] table)
-
uncompressGetCodeLittleEndian
private final MMRDecompressor.Code uncompressGetCodeLittleEndian(MMRDecompressor.Code[] table)
-
uncompressGetNextCodeLittleEndian
private final int uncompressGetNextCodeLittleEndian()
Fill up the code word in little endian mode. This is a hotspot, therefore the algorithm is heavily optimised. For the frequent cases (i.e. short words) we try to get away with as little work as possible.
This method returns code words of 16 bits, which are aligned to the 24th bit. The lowest 8 bits are used as a "queue" of bits so that an access to the actual data is only needed, when this queue becomes empty.
-
fillBuffer
private void fillBuffer(int byteOffset) throws java.io.IOException
- Throws:
java.io.IOException
-
align
private void align()
Skip to next byte
-
-