Class ZCompressorInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.compressors.CompressorInputStream
org.apache.commons.compress.compressors.lzw.LZWInputStream
org.apache.commons.compress.compressors.z.ZCompressorInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,InputStreamStatistics
Input stream that decompresses .Z files.
- Since:
- 1.7
- This class is not thread-safe
-
Field Summary
Fields inherited from class org.apache.commons.compress.compressors.lzw.LZWInputStream
DEFAULT_CODE_SIZE, in, UNUSED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionZCompressorInputStream(InputStream inputStream) ZCompressorInputStream(InputStream inputStream, int memoryLimitInKb) -
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.static booleanmatches(byte[] signature, int length) Checks if the signature matches what is expected for a UNIX compress file.protected intReads the next code from the stream.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, 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, read, reset, skipMethods 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
-
Constructor Details
-
ZCompressorInputStream
- Throws:
IOException
-
ZCompressorInputStream
- Throws:
IOException
-
-
Method Details
-
matches
Checks if the signature matches what is expected for a UNIX compress file.- Parameters:
signature- the bytes to checklength- the number of bytes to check- Returns:
- true, if this stream is a UNIX compress compressed stream, false otherwise
- Since:
- 1.9
-
addEntry
Add a new entry to the dictionary.This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
- Specified by:
addEntryin classLZWInputStream- Parameters:
previousCode- the previous codecharacter- the next character to append- Returns:
- the new code
- Throws:
IOException- on error
-
decompressNextSymbol
Read the next code and expand it.This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
- Specified by:
decompressNextSymbolin classLZWInputStream- Returns:
- the expanded next code, negative on EOF
- Throws:
IOException- on error
-
readNextCode
Reads the next code from the stream.This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.
- Overrides:
readNextCodein classLZWInputStream- Returns:
- the next code
- Throws:
IOException- on error
-