Package org.apache.pekko.stream
Class ZstdCompressionSettings
java.lang.Object
org.apache.pekko.stream.ZstdCompressionSettings
Settings for the zstd compression operators,
Compression.zstd in the Scala and Java DSLs.
- Since:
- 2.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ZstdCompressionSettingsapply()Scala API: the default settings, the default compression level with auto flush, the default window size of the level and no dictionarybooleanstatic ZstdCompressionSettingscreate()Java API: the default settings, the default compression level with auto flush, the default window size of the level and no dictionaryintlevel()toString()intwithAutoFlush(boolean autoFlush) If true (the default) the compressor flushes after every single element in the stream, so that every emittedByteStringcan be fully decompressed without waiting for more data.withDictionary(ZstdDictionary dictionary) Java API: compress with a dictionary.withDictionary(ZstdDictionary dictionary) Scala API: compress with a dictionary.withLevel(int level) The compression level, must be greater or equal toCompression.ZstdMinCompressionLeveland less than or equal toCompression.ZstdMaxCompressionLevel.Compress without a dictionary, the default.withWindowLog(int windowLog) The log2 of the maximum window size, which a decompressor needs to buffer.
-
Constructor Details
-
ZstdCompressionSettings
public ZstdCompressionSettings()
-
-
Method Details
-
apply
Scala API: the default settings, the default compression level with auto flush, the default window size of the level and no dictionary -
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
The compression level, must be greater or equal toCompression.ZstdMinCompressionLeveland less than or equal toCompression.ZstdMaxCompressionLevel. Defaults toCompression.ZstdDefaultCompressionLevel. -
withAutoFlush
If true (the default) the compressor flushes after every single element in the stream, so that every emittedByteStringcan 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
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 toCompression.ZstdMinWindowLogand less than or equal toCompression.ZstdMaxWindowLog. For example, RFC 9659 limits the HTTPzstdcontent-coding to a window log of 23 (8 MiB). -
withDictionary
Scala API: compress with a dictionary. The output can only be decompressed with the same dictionary. -
withDictionary
Java API: compress with a dictionary. The output can only be decompressed with the same dictionary. -
withoutDictionary
Compress without a dictionary, the default. -
toString
-