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:
Closeable,AutoCloseable,InputStreamStatistics
Input stream that decompresses ZIP method 1 (unshrinking). A variation of the LZW algorithm, with some twists.
- Since:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean[]private static final intprivate static final intFields inherited from class org.apache.commons.compress.compressors.lzw.LZWInputStream
DEFAULT_CODE_SIZE, in, UNUSED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionUnshrinkingInputStream(InputStream inputStream) IOException is not actually thrown! -
Method Summary
Modifier and TypeMethodDescriptionprotected intaddEntry(int previousCode, byte character) Add a new entry to the dictionary.protected intRead the next code and expand it.private voidMethods 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, setTableSizeMethods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytesMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics
getUncompressedCount
-
Field Details
-
MAX_CODE_SIZE
private static final int MAX_CODE_SIZE- See Also:
-
MAX_TABLE_SIZE
private static final int MAX_TABLE_SIZE- See Also:
-
isUsed
private final boolean[] isUsed
-
-
Constructor Details
-
UnshrinkingInputStream
IOException is not actually thrown!- Parameters:
inputStream-- Throws:
IOException- IOException is not actually thrown!
-
-
Method Details
-
addEntry
Description 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:
IOException- on error
-
partialClear
private void partialClear() -
decompressNextSymbol
Description copied from class:LZWInputStreamRead the next code and expand it.- Specified by:
decompressNextSymbolin classLZWInputStream- Returns:
- the expanded next code, negative on EOF
- Throws:
IOException- on error
-