Class LZWCodec.LZWEncodeDictionary

java.lang.Object
com.helger.base.codec.impl.LZWCodec.AbstractLZWDictionary
com.helger.base.codec.impl.LZWCodec.LZWEncodeDictionary
Enclosing class:
LZWCodec

protected static class LZWCodec.LZWEncodeDictionary extends LZWCodec.AbstractLZWDictionary
  • Constructor Details

    • LZWEncodeDictionary

      public LZWEncodeDictionary()
      Constructor.
  • Method Details

    • reset

      public void reset()
      Description copied from class: LZWCodec.AbstractLZWDictionary
      Reset this dictionary to its initial state, clearing all entries and re-initializing with the 256 single-byte entries.
      Overrides:
      reset in class LZWCodec.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:
      true if a new entry was added to the dictionary, false otherwise.
    • getNode

      public @Nullable LZWCodec.LZWNode getNode(byte @NonNull [] aBytes)
      Get the node in the encoding tree corresponding to the provided byte sequence.
      Parameters:
      aBytes - The byte sequence to look up. May not be null.
      Returns:
      The corresponding node, or null if no such node exists.