|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jimi.core.util.lzw.LZWDecompressor
Generic LZW decompressor, with support for the TIFF variation.
Field Summary | |
protected int |
codeSize_
|
protected int |
count_
|
protected int |
initialCodeSize_
|
protected BitInput |
input_
|
protected boolean |
isLeftOver_
|
protected int |
leftOverCode_
|
protected int |
leftOverIndex_
|
protected int |
leftOverOldCode_
|
protected int |
limit_
|
protected int |
oldCode_
|
protected byte |
oldCodeFirstChar_
|
protected com.sun.jimi.core.util.lzw.LZWDecompressionStringTable |
table_
|
protected boolean |
tiff_
|
Constructor Summary | |
LZWDecompressor(java.io.InputStream in,
int codeSize,
boolean TIFF)
Constructs an LZW decompressor to decode data from a stream. |
Method Summary | |
protected void |
clearTable()
Clears the table and resets the bit-size of input data. |
int |
decompress(byte[] buf)
Decompresses into a byte-array buffer. |
protected int |
getNextCode()
Reads the next code from the encrypted input. |
void |
gifFinishBlocks()
Due to the way that decompress() is written to just retreive the required data when the end of the compressed data is reached the trailing END OF INPUT code will never be read and the Zero lenght block as the last block will never be read. |
protected void |
incrementCodeSize()
Increments the bit-size of input data by one bit. |
protected void |
resetCodeSize()
Resets the bit-size of input data. |
void |
setInputStream(java.io.InputStream in)
Sets a new InputStream as the LZW source and re-initializes the decoder. |
protected int |
writeCode(byte[] buf,
int index,
int code)
Writes a code into the buffer at a specified index. |
protected int |
writeCode(byte[] buf,
int index,
int code,
int skip)
Writes a code into the buffer at a specified index. |
protected int |
writeLeftOver(byte[] buf)
Writes leftover codes into a buffer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected BitInput input_
protected int initialCodeSize_
protected int codeSize_
protected int limit_
protected boolean tiff_
protected com.sun.jimi.core.util.lzw.LZWDecompressionStringTable table_
protected int count_
protected int oldCode_
protected byte oldCodeFirstChar_
protected int leftOverCode_
protected int leftOverIndex_
protected int leftOverOldCode_
protected boolean isLeftOver_
Constructor Detail |
public LZWDecompressor(java.io.InputStream in, int codeSize, boolean TIFF)
in
- The input stream to read LZW-encoded data from.codeSize
- The number of bits in each value.TIFF
- True if the TIFF variation of LZW is to be used.Method Detail |
public void setInputStream(java.io.InputStream in)
in
- The InputStream to read LZW-encoded data from.public int decompress(byte[] buf) throws java.io.IOException
buf
- The buffer to fill with decoded data.protected int writeCode(byte[] buf, int index, int code)
buf
- The buffer to write into.index
- The starting index in the buffer.code
- The code to write a string for.writeLeftOver(byte[])
protected int writeCode(byte[] buf, int index, int code, int skip)
buf
- The buffer to write into.index
- The starting index in the buffer.code
- The code to write a string for.skip
- The number of bytes to skip from the start of the string.writeLeftOver(byte[])
protected int writeLeftOver(byte[] buf)
buf
- The buffer to write into.writeCode(byte[], int, int)
protected int getNextCode() throws java.io.IOException
protected void clearTable()
protected void resetCodeSize()
protected void incrementCodeSize()
public void gifFinishBlocks() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |