Package com.helger.base.codec.impl
Class LZWCodec.LZWEncodeDictionary
java.lang.Object
com.helger.base.codec.impl.LZWCodec.AbstractLZWDictionary
com.helger.base.codec.impl.LZWCodec.LZWEncodeDictionary
- Enclosing class:
LZWCodec
-
Field Summary
Fields inherited from class com.helger.base.codec.impl.LZWCodec.AbstractLZWDictionary
CODE_CLEARTABLE, CODE_EOF, m_aTab, m_nCodeBits, m_nFreeCode, MAX_CODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint@Nullable LZWCodec.LZWNodegetNode(byte @NonNull [] aBytes) Get the node in the encoding tree corresponding to the provided byte sequence.voidreset()Reset this dictionary to its initial state, clearing all entries and re-initializing with the 256 single-byte entries.booleanvisit(byte nByteToVisit) Visit a single byte during the encoding process.Methods inherited from class com.helger.base.codec.impl.LZWCodec.AbstractLZWDictionary
addEntry, getNextFreeCode
-
Constructor Details
-
LZWEncodeDictionary
public LZWEncodeDictionary()Constructor.
-
-
Method Details
-
reset
public void reset()Description copied from class:LZWCodec.AbstractLZWDictionaryReset this dictionary to its initial state, clearing all entries and re-initializing with the 256 single-byte entries.- Overrides:
resetin classLZWCodec.AbstractLZWDictionary
-
getCodeLength
public int getCodeLength()- Returns:
- The current code length in bits used for encoding.
-
visit
public boolean visit(byte nByteToVisit) Visit a single byte during the encoding process. If a new byte sequence is found that is not yet in the dictionary, it is added.- Parameters:
nByteToVisit- The byte to process.- Returns:
trueif a new entry was added to the dictionary,falseotherwise.
-
getNode
Get the node in the encoding tree corresponding to the provided byte sequence.- Parameters:
aBytes- The byte sequence to look up. May not benull.- Returns:
- The corresponding node, or
nullif no such node exists.
-