Class ZstdCompressionSettings

java.lang.Object
org.apache.pekko.stream.ZstdCompressionSettings

public final class ZstdCompressionSettings extends Object
Settings for the zstd compression operators, Compression.zstd in the Scala and Java DSLs.

Since:
2.0.0
  • Constructor Details

    • ZstdCompressionSettings

      public ZstdCompressionSettings()
  • Method Details

    • apply

      public static ZstdCompressionSettings apply()
      Scala API: the default settings, the default compression level with auto flush, the default window size of the level and no dictionary
    • create

      public static ZstdCompressionSettings create()
      Java API: the default settings, the default compression level with auto flush, the default window size of the level and no dictionary
    • level

      public int level()
    • autoFlush

      public boolean autoFlush()
    • windowLog

      public int windowLog()
    • withLevel

      public ZstdCompressionSettings withLevel(int level)
      The compression level, must be greater or equal to Compression.ZstdMinCompressionLevel and less than or equal to Compression.ZstdMaxCompressionLevel. Defaults to Compression.ZstdDefaultCompressionLevel.
    • withAutoFlush

      public ZstdCompressionSettings withAutoFlush(boolean autoFlush)
      If true (the default) the compressor flushes after every single element in the stream, so that every emitted ByteString can be fully decompressed without waiting for more data. If false, the compressor only emits output when the compression algorithm produces it, which can improve the compression ratio for small elements.
    • withWindowLog

      public ZstdCompressionSettings withWindowLog(int windowLog)
      The log2 of the maximum window size, which a decompressor needs to buffer. 0 (the default) uses the default of the compression level, otherwise it must be greater or equal to Compression.ZstdMinWindowLog and less than or equal to Compression.ZstdMaxWindowLog. For example, RFC 9659 limits the HTTP zstd content-coding to a window log of 23 (8 MiB).
    • withDictionary

      public ZstdCompressionSettings withDictionary(ZstdDictionary dictionary)
      Scala API: compress with a dictionary. The output can only be decompressed with the same dictionary.
    • withDictionary

      public ZstdCompressionSettings withDictionary(ZstdDictionary dictionary)
      Java API: compress with a dictionary. The output can only be decompressed with the same dictionary.
    • withoutDictionary

      public ZstdCompressionSettings withoutDictionary()
      Compress without a dictionary, the default.
    • toString

      public String toString()
      Overrides:
      toString in class Object