Package org.apache.pekko.stream.javadsl
Class Compression
java.lang.Object
org.apache.pekko.stream.javadsl.Compression
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Flow<ByteString,
ByteString, NotUsed> deflate()
Creates a flow that deflate-compresses a stream of ByteString.static Flow<ByteString,
ByteString, NotUsed> deflate
(int level, boolean nowrap) Same asdeflate()
with configurable level and nowrapstatic Flow<ByteString,
ByteString, NotUsed> gunzip
(int maxBytesPerChunk) Creates a Flow that decompresses gzip-compressed stream of data.static Flow<ByteString,
ByteString, NotUsed> gzip()
Creates a flow that gzip-compresses a stream of ByteStrings.static Flow<ByteString,
ByteString, NotUsed> gzip
(int level) Same asgzip()
with a custom level.static Flow<ByteString,
ByteString, NotUsed> inflate
(int maxBytesPerChunk) Creates a Flow that decompresses deflate-compressed stream of data.static Flow<ByteString,
ByteString, NotUsed> inflate
(int maxBytesPerChunk, boolean nowrap) Same asinflate(int)
with configurable maximum output length and nowrap
-
Constructor Details
-
Compression
public Compression()
-
-
Method Details
-
gunzip
Creates a Flow that decompresses gzip-compressed stream of data.- Parameters:
maxBytesPerChunk
- Maximum length of the outputpekko.util.ByteString
chunk.
-
inflate
Creates a Flow that decompresses deflate-compressed stream of data.- Parameters:
maxBytesPerChunk
- Maximum length of the outputpekko.util.ByteString
chunk.
-
inflate
Same asinflate(int)
with configurable maximum output length and nowrap- Parameters:
maxBytesPerChunk
- Maximum length of the outputpekko.util.ByteString
chunk.nowrap
- if true then use GZIP compatible decompression
-
gzip
Creates a flow that gzip-compresses a stream of ByteStrings. Note that the compressor will SYNC_FLUSH after everypekko.util.ByteString
so that it is guaranteed that everypekko.util.ByteString
coming out of the flow can be fully decompressed without waiting for additional data. This may come at a compression performance cost for very small chunks. -
gzip
Same asgzip()
with a custom level.- Parameters:
level
- Compression level (0-9)
-
deflate
Creates a flow that deflate-compresses a stream of ByteString. Note that the compressor will SYNC_FLUSH after everypekko.util.ByteString
so that it is guaranteed that everypekko.util.ByteString
coming out of the flow can be fully decompressed without waiting for additional data. This may come at a compression performance cost for very small chunks. -
deflate
Same asdeflate()
with configurable level and nowrap- Parameters:
level
- Compression level (0-9)nowrap
- if true then use GZIP compatible compression
-