public class LZWCompressor extends Object
Modifier and Type | Field and Description |
---|---|
(package private) BitFile |
bf_
output destination for bit codes
|
(package private) int |
clearCode_
reserved clear code based on code size
|
(package private) int |
codeSize_
base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF
|
(package private) int |
endOfInfo_
reserved end of data code based on code size
|
(package private) int |
limit_
limit at which current number of bits code size has to be increased
|
(package private) LZWStringTable |
lzss_
general purpose LZW string table
|
(package private) int |
numBits_
current number bits output for each code
|
(package private) short |
prefix_
the prefix code which represents the predecessor string to current input point
|
(package private) boolean |
tiffFudge_
modify the limits of the code values in LZW encoding due to TIFF bug / feature
|
Constructor and Description |
---|
LZWCompressor(ImageOutputStream out,
int codeSize,
boolean TIFF) |
Modifier and Type | Method and Description |
---|---|
void |
compress(byte[] buf,
int offset,
int length) |
void |
dump(PrintStream out) |
void |
flush()
Indicate to compressor that no more data to go so write out
any remaining buffered data.
|
int codeSize_
int clearCode_
int endOfInfo_
int numBits_
int limit_
short prefix_
BitFile bf_
LZWStringTable lzss_
boolean tiffFudge_
public LZWCompressor(ImageOutputStream out, int codeSize, boolean TIFF) throws IOException
out
- destination for compressed datacodeSize
- the initial code size for the LZW compressorTIFF
- flag indicating that TIFF lzw fudge needs to be appliedIOException
- if underlying output stream errorpublic void compress(byte[] buf, int offset, int length) throws IOException
buf
- data to be compressed to output streamIOException
- if underlying output stream errorpublic void flush() throws IOException
IOException
- if underlying output stream errorpublic void dump(PrintStream out)
Copyright © 2017 Open Microscopy Environment