Top Fields Constructors Methods
com.sun.imageio.plugins.common

public Class LZWCompressor

extends Object
Class Inheritance
Imports
java.io.IOException, .PrintStream, javax.imageio.stream.ImageOutputStream

Field Summary

Modifier and TypeField and Description
pack-priv BitFile
bf

output destination for bit codes

pack-priv int
clearCode

reserved clear code based on code size

pack-priv int
codeSize

base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF

pack-priv int
endOfInfo

reserved end of data code based on code size

pack-priv int
limit

limit at which current number of bits code size has to be increased

pack-priv LZWStringTable
lzss

general purpose LZW string table

pack-priv int
numBits

current number bits output for each code

pack-priv short
prefix

the prefix code which represents the predecessor string to current input point

pack-priv boolean
tiffFudge

modify the limits of the code values in LZW encoding due to TIFF bug / feature

Constructor Summary

AccessConstructor and Description
public
LZWCompressor(ImageOutputStream
destination for compressed data
out
,
int
the initial code size for the LZW compressor
codeSize
,
boolean
flag indicating that TIFF lzw fudge needs to be applied
TIFF
)

Method Summary

Modifier and TypeMethod and Description
public void
compress(byte[]
data to be compressed to output stream
buf
,
int offset, int length)

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bfback to summary
pack-priv BitFile bf

output destination for bit codes

clearCodeback to summary
pack-priv int clearCode

reserved clear code based on code size

codeSizeback to summary
pack-priv int codeSize

base underlying code size of data being compressed 8 for TIFF, 1 to 8 for GIF

endOfInfoback to summary
pack-priv int endOfInfo

reserved end of data code based on code size

limitback to summary
pack-priv int limit

limit at which current number of bits code size has to be increased

lzssback to summary
pack-priv LZWStringTable lzss

general purpose LZW string table

numBitsback to summary
pack-priv int numBits

current number bits output for each code

prefixback to summary
pack-priv short prefix

the prefix code which represents the predecessor string to current input point

tiffFudgeback to summary
pack-priv boolean tiffFudge

modify the limits of the code values in LZW encoding due to TIFF bug / feature

Constructor Detail

LZWCompressorback to summary
public LZWCompressor(ImageOutputStream out, int codeSize, boolean TIFF) throws IOException
Parameters
out:ImageOutputStream

destination for compressed data

codeSize:int

the initial code size for the LZW compressor

TIFF:boolean

flag indicating that TIFF lzw fudge needs to be applied

Exceptions
IOException:
if underlying output stream error

Method Detail

compressback to summary
public void compress(byte[] buf, int offset, int length) throws IOException
Parameters
buf:byte[]

data to be compressed to output stream

Exceptions
IOException:
if underlying output stream error
dumpback to summary
public void dump(PrintStream out)
flushback to summary
public void flush() throws IOException