Top Description Fields Constructors Methods
org.apache.commons.compress.compressors.z

public Class ZCompressorInputStream

extends LZWInputStream
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.ByteOrder, org.apache.commons.compress.compressors.lzw.LZWInputStream

Input stream that decompresses .Z files.
Since
1.7

Field Summary

Modifier and TypeField and Description
private static final int
private final boolean
private static final int
private static final int
private static final int
private final int
private long
Inherited from org.apache.commons.compress.compressors.lzw.LZWInputStream:
DEFAULT_CODE_SIZEinUNUSED_PREFIX

Constructor Summary

AccessConstructor and Description
public
public
ZCompressorInputStream(final InputStream inputStream, final int memoryLimitInKb)

Method Summary

Modifier and TypeMethod and Description
protected int
addEntry(final int
the previous code
previousCode
,
final byte
the next character to append
character
)

Implements abstract org.apache.commons.compress.compressors.lzw.LZWInputStream.addEntry.

Add a new entry to the dictionary.
private void
protected int
public static boolean

Returns:

true, if this stream is a Unix compress compressed stream, false otherwise
matches
(final byte[]
the bytes to check
signature
,
final int
the number of bytes to check
length
)

Checks if the signature matches what is expected for a Unix compress file.

protected int
private void
Inherited from org.apache.commons.compress.compressors.lzw.LZWInputStream:
addEntryaddRepeatOfPreviousCodecloseexpandCodeToOutputStackgetClearCodegetCodeSizegetCompressedCountgetPrefixgetPrefixesLengthgetTableSizeincrementCodeSizeinitializeTablesinitializeTablesreadreadresetCodeSizeresetPreviousCodesetClearCodesetCodeSizesetPrefixsetTableSize

Field Detail

BLOCK_MODE_MASKback to summary
private static final int BLOCK_MODE_MASK
blockModeback to summary
private final boolean blockMode
MAGIC_1back to summary
private static final int MAGIC_1
MAGIC_2back to summary
private static final int MAGIC_2
MAX_CODE_SIZE_MASKback to summary
private static final int MAX_CODE_SIZE_MASK
maxCodeSizeback to summary
private final int maxCodeSize
totalCodesReadback to summary
private long totalCodesRead

Constructor Detail

ZCompressorInputStreamback to summary
public ZCompressorInputStream(final InputStream inputStream) throws IOException
ZCompressorInputStreamback to summary
public ZCompressorInputStream(final InputStream inputStream, final int memoryLimitInKb) throws IOException

Method Detail

addEntryback to summary
protected int addEntry(final int previousCode, final byte character) throws IOException

Implements abstract org.apache.commons.compress.compressors.lzw.LZWInputStream.addEntry.

Doc from org.apache.commons.compress.compressors.lzw.LZWInputStream.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.

Parameters
previousCode:int

the previous code

character:byte

the next character to append

Returns:int

the new code

Annotations
@Override
Exceptions
IOException:
on error
clearEntriesback to summary
private void clearEntries()
decompressNextSymbolback to summary
protected int decompressNextSymbol() throws IOException

Implements abstract org.apache.commons.compress.compressors.lzw.LZWInputStream.decompressNextSymbol.

Doc from org.apache.commons.compress.compressors.lzw.LZWInputStream.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.

Returns:int

the expanded next code, negative on EOF

Annotations
@Override
Exceptions
IOException:
on error
matchesback to summary
public static boolean matches(final byte[] signature, final int length)

Checks if the signature matches what is expected for a Unix compress file.

Parameters
signature:byte[]

the bytes to check

length:int

the number of bytes to check

Returns:boolean

true, if this stream is a Unix compress compressed stream, false otherwise

Since
1.9
readNextCodeback to summary
protected int readNextCode() throws IOException

Overrides org.apache.commons.compress.compressors.lzw.LZWInputStream.readNextCode.

Doc from org.apache.commons.compress.compressors.lzw.LZWInputStream.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.

Returns:int

the next code

Annotations
@Override
Exceptions
IOException:
on error
reAlignReadingback to summary
private void reAlignReading() throws IOException