Class MyLzwDecompressor
java.lang.Object
org.apache.commons.imaging.common.mylzw.MyLzwDecompressor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteOrder
private final int
private int
private int
private final int
private final int
private final MyLzwDecompressor.Listener
private static final int
private final byte[][]
private boolean
private int
-
Constructor Summary
ConstructorsConstructorDescriptionMyLzwDecompressor
(int initialCodeSize, ByteOrder byteOrder) MyLzwDecompressor
(int initialCodeSize, ByteOrder byteOrder, MyLzwDecompressor.Listener listener) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addStringToTable
(byte[] bytes) private byte[]
appendBytes
(byte[] bytes, byte b) private void
private void
byte[]
decompress
(InputStream is, int expectedLength) private byte
firstChar
(byte[] bytes) private int
private void
private void
private boolean
isInTable
(int code) void
private byte[]
stringFromCode
(int code) private void
writeToResult
(OutputStream os, byte[] bytes)
-
Field Details
-
MAX_TABLE_SIZE
private static final int MAX_TABLE_SIZE- See Also:
-
table
private final byte[][] table -
codeSize
private int codeSize -
initialCodeSize
private final int initialCodeSize -
codes
private int codes -
byteOrder
-
listener
-
clearCode
private final int clearCode -
eoiCode
private final int eoiCode -
written
private int written -
tiffLZWMode
private boolean tiffLZWMode
-
-
Constructor Details
-
MyLzwDecompressor
-
MyLzwDecompressor
public MyLzwDecompressor(int initialCodeSize, ByteOrder byteOrder, MyLzwDecompressor.Listener listener)
-
-
Method Details
-
initializeTable
private void initializeTable() -
clearTable
private void clearTable() -
getNextCode
- Throws:
IOException
-
stringFromCode
- Throws:
IOException
-
isInTable
private boolean isInTable(int code) -
firstChar
private byte firstChar(byte[] bytes) -
addStringToTable
- Throws:
IOException
-
appendBytes
private byte[] appendBytes(byte[] bytes, byte b) -
writeToResult
- Throws:
IOException
-
setTiffLZWMode
public void setTiffLZWMode() -
decompress
- Throws:
IOException
-
checkCodeSize
private void checkCodeSize() -
incrementCodeSize
private void incrementCodeSize()
-