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

public Class LZWStringTable

extends Object
Class Inheritance
Imports
java.io.PrintStream

General purpose LZW String Table. Extracted from GIFEncoder by Adam Doppelt Comments added by Robin Luiten expandCode added by Robin Luiten The strLen table to give quick access to the length of an expanded code for use by the expandCode method added by Robin.

Field Summary

Modifier and TypeField and Description
private static final short
private static final short
private static final short
private static final int
private static final int
private static final short
pack-priv short
private static final int
RES_CODES

codesize + Reserved Codes

pack-priv byte[]
pack-priv short[]
pack-priv int[]
pack-priv short[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
addCharString(short index, byte b)

public void
clearTable(int codesize)

public void
public int
expandCode(byte[] buf, int offset, short code, int skipHead)

public short
findCharString(short index, byte b)

public static int
hash(short index, byte lastbyte)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HASH_FREEback to summary
private static final short HASH_FREE
HASHSIZEback to summary
private static final short HASHSIZE
HASHSTEPback to summary
private static final short HASHSTEP
MAXBITSback to summary
private static final int MAXBITS
MAXSTRback to summary
private static final int MAXSTR
NEXT_FIRSTback to summary
private static final short NEXT_FIRST
numStringsback to summary
pack-priv short numStrings
RES_CODESback to summary
private static final int RES_CODES

codesize + Reserved Codes

strChrback to summary
pack-priv byte[] strChr
strHshback to summary
pack-priv short[] strHsh
strLenback to summary
pack-priv int[] strLen
strNxtback to summary
pack-priv short[] strNxt

Constructor Detail

LZWStringTableback to summary
public LZWStringTable()

Method Detail

addCharStringback to summary
public int addCharString(short index, byte b)
clearTableback to summary
public void clearTable(int codesize)
dumpback to summary
public void dump(PrintStream out)
expandCodeback to summary
public int expandCode(byte[] buf, int offset, short code, int skipHead)
findCharStringback to summary
public short findCharString(short index, byte b)
hashback to summary
public static int hash(short index, byte lastbyte)