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 int
private static final int
Fields 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 int
addEntry
(int previousCode, byte character) Add a new entry to the dictionary.protected int
Read the next code and expand it.private void
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, read, readAllBytes, 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 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:LZWInputStream
Add a new entry to the dictionary.- Specified by:
addEntry
in 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:LZWInputStream
Read the next code and expand it.- Specified by:
decompressNextSymbol
in classLZWInputStream
- Returns:
- the expanded next code, negative on EOF
- Throws:
IOException
- on error
-