Class UnshrinkingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.compress.compressors.CompressorInputStream
-
- org.apache.commons.compress.compressors.lzw.LZWInputStream
-
- org.apache.commons.compress.archivers.zip.UnshrinkingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,InputStreamStatistics
class UnshrinkingInputStream extends LZWInputStream
Input stream that decompresses ZIP method 1 (unshrinking). A variation of the LZW algorithm, with some twists.- Since:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private boolean[]isUsedprivate static intMAX_CODE_SIZEprivate static intMAX_TABLE_SIZE-
Fields inherited from class org.apache.commons.compress.compressors.lzw.LZWInputStream
DEFAULT_CODE_SIZE, in, UNUSED_PREFIX
-
-
Constructor Summary
Constructors Constructor Description UnshrinkingInputStream(java.io.InputStream inputStream)IOException is not actually thrown!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intaddEntry(int previousCode, byte character)Add a new entry to the dictionary.protected intdecompressNextSymbol()Read the next code and expand it.private voidpartialClear()-
Methods inherited from class org.apache.commons.compress.compressors.lzw.LZWInputStream
addEntry, addRepeatOfPreviousCode, close, expandCodeToOutputStack, getClearCode, getCodeSize, getCompressedCount, getPrefix, getPrefixesLength, getTableSize, incrementCodeSize, initializeTables, initializeTables, read, read, readNextCode, resetCodeSize, resetPreviousCode, setClearCode, setCodeSize, setPrefix, setTableSize
-
Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics
getUncompressedCount
-
-
-
-
Field Detail
-
MAX_CODE_SIZE
private static final int MAX_CODE_SIZE
- See Also:
- Constant Field Values
-
MAX_TABLE_SIZE
private static final int MAX_TABLE_SIZE
- See Also:
- Constant Field Values
-
isUsed
private final boolean[] isUsed
-
-
Method Detail
-
addEntry
protected int addEntry(int previousCode, byte character) throws java.io.IOExceptionDescription copied from class:LZWInputStreamAdd a new entry to the dictionary.- Specified by:
addEntryin classLZWInputStream- Parameters:
previousCode- the previous codecharacter- the next character to append- Returns:
- the new code
- Throws:
java.io.IOException- on error
-
partialClear
private void partialClear()
-
decompressNextSymbol
protected int decompressNextSymbol() throws java.io.IOExceptionDescription copied from class:LZWInputStreamRead the next code and expand it.- Specified by:
decompressNextSymbolin classLZWInputStream- Returns:
- the expanded next code, negative on EOF
- Throws:
java.io.IOException- on error
-
-