Class MyLzwDecompressor
java.lang.Object
org.apache.commons.imaging.mylzw.MyLzwDecompressor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteOrderprivate final intprivate intprivate intprivate final intprivate final intprivate final MyLzwDecompressor.Listenerprivate static final intprivate final byte[][]private final booleanprivate int -
Constructor Summary
ConstructorsConstructorDescriptionMyLzwDecompressor(int initialCodeSize, ByteOrder byteOrder, boolean tiffLZWMode) MyLzwDecompressor(int initialCodeSize, ByteOrder byteOrder, boolean tiffLZWMode, MyLzwDecompressor.Listener listener) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddStringToTable(byte[] bytes) private byte[]appendBytes(byte[] bytes, byte b) private voidprivate voidbyte[]decompress(InputStream is, int expectedLength) private bytefirstChar(byte[] bytes) private intprivate voidprivate voidprivate booleanisInTable(int code) private byte[]stringFromCode(int code) private voidwriteToResult(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 final boolean tiffLZWMode
-
-
Constructor Details
-
MyLzwDecompressor
public MyLzwDecompressor(int initialCodeSize, ByteOrder byteOrder, boolean tiffLZWMode) throws ImagingException - Throws:
ImagingException
-
MyLzwDecompressor
public MyLzwDecompressor(int initialCodeSize, ByteOrder byteOrder, boolean tiffLZWMode, MyLzwDecompressor.Listener listener) throws ImagingException - Throws:
ImagingException
-
-
Method Details
-
addStringToTable
private void addStringToTable(byte[] bytes) -
appendBytes
private byte[] appendBytes(byte[] bytes, byte b) -
checkCodeSize
private void checkCodeSize() -
clearTable
private void clearTable() -
decompress
- Throws:
IOException
-
firstChar
private byte firstChar(byte[] bytes) -
getNextCode
- Throws:
IOException
-
incrementCodeSize
private void incrementCodeSize() -
initializeTable
- Throws:
ImagingException
-
isInTable
private boolean isInTable(int code) -
stringFromCode
- Throws:
ImagingException
-
writeToResult
- Throws:
IOException
-