org.apache.commons.compress.compressors.z._internal_
public abstract class InternalLZWInputStream extends CompressorInputStream
Base-class for traditional Unix ".Z" compression and the Unshrinking method of ZIP archive.
| Modifier and Type | Field and Description |
|---|---|
protected int |
bitsCached |
protected int |
bitsCachedSize |
protected byte[] |
characters |
protected int |
clearCode |
protected int |
codeSize |
protected InputStream |
in |
protected int[] |
prefixes |
protected int |
previousCode |
protected int |
tableSize |
| Modifier | Constructor and Description |
|---|---|
protected |
InternalLZWInputStream(InputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
addEntry(int previousCode,
byte character)
Add a new entry to the dictionary.
|
protected int |
addEntry(int previousCode,
byte character,
int maxTableSize)
Adds a new entry if the maximum table size hasn't been exceeded
and returns the new index.
|
protected int |
addRepeatOfPreviousCode()
Add entry for repeat of previousCode we haven't added, yet.
|
void |
close() |
protected abstract int |
decompressNextSymbol()
Read the next code and expand it.
|
protected int |
expandCodeToOutputStack(int code,
boolean addedUnfinishedEntry)
Expands the entry with index code to the output stack and may
create a new entry
|
protected void |
initializeTables(int maxCodeSize)
Initializes the arrays based on the maximum code size.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
protected int |
readNextCode()
Reads the next code from the stream.
|
protected void |
setClearCode(int codeSize)
Sets the clear code based on the code size.
|
count, count, getBytesRead, getCount, pushedBackBytesavailable, mark, markSupported, read, reset, skipprotected final InputStream in
protected int clearCode
protected int codeSize
protected int bitsCached
protected int bitsCachedSize
protected int previousCode
protected int tableSize
protected int[] prefixes
protected byte[] characters
protected InternalLZWInputStream(InputStream inputStream)
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionprotected abstract int decompressNextSymbol()
throws IOException
IOExceptionprotected abstract int addEntry(int previousCode,
byte character)
throws IOException
IOExceptionprotected void setClearCode(int codeSize)
protected void initializeTables(int maxCodeSize)
protected int readNextCode()
throws IOException
IOExceptionprotected int addEntry(int previousCode,
byte character,
int maxTableSize)
protected int addRepeatOfPreviousCode()
throws IOException
IOExceptionprotected int expandCodeToOutputStack(int code,
boolean addedUnfinishedEntry)
throws IOException
IOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.