public class ZCompressorInputStream extends LZWInputStream
Modifier and Type | Field and Description |
---|---|
private static int |
BLOCK_MODE_MASK |
private boolean |
blockMode |
private static int |
MAGIC_1 |
private static int |
MAGIC_2 |
private static int |
MAX_CODE_SIZE_MASK |
private int |
maxCodeSize |
private long |
totalCodesRead |
DEFAULT_CODE_SIZE, in, UNUSED_PREFIX
Constructor and Description |
---|
ZCompressorInputStream(java.io.InputStream inputStream) |
ZCompressorInputStream(java.io.InputStream inputStream,
int memoryLimitInKb) |
Modifier and Type | Method and Description |
---|---|
protected int |
addEntry(int previousCode,
byte character)
Add a new entry to the dictionary.
|
private void |
clearEntries() |
protected int |
decompressNextSymbol()
Read the next code and expand it.
|
static boolean |
matches(byte[] signature,
int length)
Checks if the signature matches what is expected for a Unix compress file.
|
protected int |
readNextCode()
Reads the next code from the stream.
|
private void |
reAlignReading() |
addEntry, addRepeatOfPreviousCode, close, expandCodeToOutputStack, getClearCode, getCodeSize, getCompressedCount, getPrefix, getPrefixesLength, getTableSize, incrementCodeSize, initializeTables, initializeTables, read, read, resetCodeSize, resetPreviousCode, setClearCode, setCodeSize, setPrefix, setTableSize
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUncompressedCount
private static final int MAGIC_1
private static final int MAGIC_2
private static final int BLOCK_MODE_MASK
private static final int MAX_CODE_SIZE_MASK
private final boolean blockMode
private final int maxCodeSize
private long totalCodesRead
public ZCompressorInputStream(java.io.InputStream inputStream, int memoryLimitInKb) throws java.io.IOException
java.io.IOException
public ZCompressorInputStream(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException
private void clearEntries()
protected int readNextCode() throws java.io.IOException
This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
readNextCode
in class LZWInputStream
java.io.IOException
- on errorprivate void reAlignReading() throws java.io.IOException
java.io.IOException
protected int addEntry(int previousCode, byte character) throws java.io.IOException
This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
addEntry
in class LZWInputStream
previousCode
- the previous codecharacter
- the next character to appendjava.io.IOException
- on errorprotected int decompressNextSymbol() throws java.io.IOException
This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
decompressNextSymbol
in class LZWInputStream
java.io.IOException
- on errorpublic static boolean matches(byte[] signature, int length)
signature
- the bytes to checklength
- the number of bytes to check