Class ZstdCompressor
java.lang.Object
org.apache.pekko.http.scaladsl.coding.Compressor
org.apache.pekko.http.scaladsl.coding.ZstdCompressor
INTERNAL API
Adapts the zstd compressor of pekko-stream. It is created lazily, as it holds a native context that is
only released by cleanup, and an encoder flow that is never materialized is never cleaned up.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Release any native resources held by this compressor.org.apache.pekko.util.ByteStringcompress(org.apache.pekko.util.ByteString input) Compresses the given input and returns compressed data.org.apache.pekko.util.ByteStringcompressAndFinish(org.apache.pekko.util.ByteString input) Combines `compress` + `finish`org.apache.pekko.util.ByteStringcompressAndFlush(org.apache.pekko.util.ByteString input) Combines `compress` + `flush`org.apache.pekko.util.ByteStringfinish()Closes this compressed stream and return the remaining compressed data.org.apache.pekko.util.ByteStringflush()Flushes any output data and returns the currently remaining compressed data.
-
Constructor Details
-
ZstdCompressor
public ZstdCompressor(int compressionLevel, int windowLog)
-
-
Method Details
-
cleanup
public void cleanup()Description copied from class:CompressorRelease any native resources held by this compressor. Idempotent.- Overrides:
cleanupin classCompressor
-
compress
public org.apache.pekko.util.ByteString compress(org.apache.pekko.util.ByteString input) Description copied from class:CompressorCompresses the given input and returns compressed data. The implementation can and will choose to buffer output data to improve compression. UseflushorcompressAndFlushto make sure that all input data has been compressed and pending output data has been returned.- Specified by:
compressin classCompressor- Parameters:
input- (undocumented)- Returns:
- (undocumented)
-
compressAndFinish
public org.apache.pekko.util.ByteString compressAndFinish(org.apache.pekko.util.ByteString input) Description copied from class:CompressorCombines `compress` + `finish`- Specified by:
compressAndFinishin classCompressor
-
compressAndFlush
public org.apache.pekko.util.ByteString compressAndFlush(org.apache.pekko.util.ByteString input) Description copied from class:CompressorCombines `compress` + `flush`- Specified by:
compressAndFlushin classCompressor
-
finish
public org.apache.pekko.util.ByteString finish()Description copied from class:CompressorCloses this compressed stream and return the remaining compressed data. After calling this method, this Compressor cannot be used any further.- Specified by:
finishin classCompressor- Returns:
- (undocumented)
-
flush
public org.apache.pekko.util.ByteString flush()Description copied from class:CompressorFlushes any output data and returns the currently remaining compressed data.- Specified by:
flushin classCompressor- Returns:
- (undocumented)
-