Package org.apache.pekko.stream.scaladsl
Class Compression
- java.lang.Object
-
- org.apache.pekko.stream.scaladsl.Compression
-
public class Compression extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Compression()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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>deflate(int level, boolean nowrap, boolean autoFlush)Same asdeflate()with configurable level, nowrap and autoFlush.static Flow<ByteString,ByteString,NotUsed>gunzip(int maxBytesPerChunk)Deprecated.Use gzipDecompress instead.static intgunzip$default$1()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>gzip(int level, boolean autoFlush)Same asgzip()with a custom level and configurable flush mode.static Flow<ByteString,ByteString,NotUsed>gzipDecompress(int maxBytesPerChunk)Creates a Flow that decompresses a gzip-compressed stream of data.static intgzipDecompress$default$1()static Flow<ByteString,ByteString,NotUsed>inflate(int maxBytesPerChunk)Creates a Flow that decompresses a deflate-compressed stream of data.static Flow<ByteString,ByteString,NotUsed>inflate(int maxBytesPerChunk, boolean nowrap)Creates a Flow that decompresses a deflate-compressed stream of data.static intinflate$default$1()static intMaxBytesPerChunkDefault()
-
-
-
Method Detail
-
MaxBytesPerChunkDefault
public static final int MaxBytesPerChunkDefault()
-
gzip
public static Flow<ByteString,ByteString,NotUsed> gzip()
Creates a flow that gzip-compresses a stream of ByteStrings. Note that the compressor will flush after every single element in stream so that it is guaranteed that everypekko.util.ByteStringcoming 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
public static Flow<ByteString,ByteString,NotUsed> gzip(int level)
Same asgzip()with a custom level.- Parameters:
level- Compression level (0-9)
-
gzip
public static Flow<ByteString,ByteString,NotUsed> gzip(int level, boolean autoFlush)
Same asgzip()with a custom level and configurable flush mode.- Parameters:
level- Compression level (0-9)autoFlush- If true will automatically flush after every single element in the stream.- Since:
- 1.3.0
-
gzipDecompress
public static Flow<ByteString,ByteString,NotUsed> gzipDecompress(int maxBytesPerChunk)
Creates a Flow that decompresses a gzip-compressed stream of data.- Parameters:
maxBytesPerChunk- Maximum length of an outputpekko.util.ByteStringchunk.- Since:
- 1.3.0
-
gzipDecompress$default$1
public static int gzipDecompress$default$1()
-
gunzip
public static Flow<ByteString,ByteString,NotUsed> gunzip(int maxBytesPerChunk)
Deprecated.Use gzipDecompress instead. Since Pekko 1.3.0.Creates a Flow that decompresses a gzip-compressed stream of data.- Parameters:
maxBytesPerChunk- Maximum length of an outputpekko.util.ByteStringchunk.
-
gunzip$default$1
public static int gunzip$default$1()
-
deflate
public static Flow<ByteString,ByteString,NotUsed> deflate()
Creates a flow that deflate-compresses a stream of ByteString. Note that the compressor will flush after every single element in stream so that it is guaranteed that everypekko.util.ByteStringcoming 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
public static Flow<ByteString,ByteString,NotUsed> deflate(int level, boolean nowrap)
Same asdeflate()with configurable level and nowrap- Parameters:
level- Compression level (0-9)nowrap- if true then use GZIP compatible compression
-
deflate
public static Flow<ByteString,ByteString,NotUsed> deflate(int level, boolean nowrap, boolean autoFlush)
Same asdeflate()with configurable level, nowrap and autoFlush.- Parameters:
level- Compression level (0-9)nowrap- if true then use GZIP compatible compressionautoFlush- If true will automatically flush after every single element in the stream.- Since:
- 1.3.0
-
inflate
public static Flow<ByteString,ByteString,NotUsed> inflate(int maxBytesPerChunk)
Creates a Flow that decompresses a deflate-compressed stream of data.- Parameters:
maxBytesPerChunk- Maximum length of an outputpekko.util.ByteStringchunk.
-
inflate
public static Flow<ByteString,ByteString,NotUsed> inflate(int maxBytesPerChunk, boolean nowrap)
Creates a Flow that decompresses a deflate-compressed stream of data.- Parameters:
maxBytesPerChunk- Maximum length of an outputpekko.util.ByteStringchunk.nowrap- if true then use GZIP compatible decompression
-
inflate$default$1
public static int inflate$default$1()
-
-