Class Dictionary

java.lang.Object
org.brotli.dec.Dictionary

public final class Dictionary extends Object
Collection of static dictionary words.

Dictionary content is loaded from binary resource when getData() is executed for the first time. Consequently, it saves memory and CPU in case dictionary is not required.

One possible drawback is that multiple threads that need dictionary data may be blocked (only once in each classworld). To avoid this, it is enough to call getData() proactively.

  • Field Details

    • MIN_DICTIONARY_WORD_LENGTH

      static final int MIN_DICTIONARY_WORD_LENGTH
      See Also:
    • MAX_DICTIONARY_WORD_LENGTH

      static final int MAX_DICTIONARY_WORD_LENGTH
      See Also:
    • data

      private static ByteBuffer data
    • offsets

      static final int[] offsets
    • sizeBits

      static final int[] sizeBits
  • Constructor Details

    • Dictionary

      public Dictionary()
  • Method Details

    • setData

      public static void setData(ByteBuffer newData, int[] newSizeBits)
    • getData

      public static ByteBuffer getData()