Class Compression$


  • public class Compression$
    extends java.lang.Object
    Creates a flow that gzip-compresses a stream of ByteStrings. Note that the compressor will SYNC_FLUSH after every ByteString so that it is guaranteed that every 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.

    FIXME: should strategy / flush mode be configurable? See https://github.com/akka/akka/issues/21849

    • Field Detail

      • MODULE$

        public static final Compression$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • Compression$

        public Compression$()
    • Method Detail

      • MaxBytesPerChunkDefault

        public final int MaxBytesPerChunkDefault()
      • gzip

        public Flow<ByteString,​ByteString,​NotUsed> gzip()
        Creates a flow that gzip-compresses a stream of ByteStrings. Note that the compressor will SYNC_FLUSH after every ByteString so that it is guaranteed that every 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.

        FIXME: should strategy / flush mode be configurable? See https://github.com/akka/akka/issues/21849

        Returns:
        (undocumented)
      • gunzip

        public Flow<ByteString,​ByteString,​NotUsed> gunzip​(int maxBytesPerChunk)
        Creates a Flow that decompresses a gzip-compressed stream of data.

        Parameters:
        maxBytesPerChunk - Maximum length of an output ByteString chunk.
        Returns:
        (undocumented)
      • gunzip$default$1

        public int gunzip$default$1()
      • deflate

        public Flow<ByteString,​ByteString,​NotUsed> deflate()
        Creates a flow that deflate-compresses a stream of ByteString. Note that the compressor will SYNC_FLUSH after every ByteString so that it is guaranteed that every 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.

        FIXME: should strategy / flush mode be configurable? See https://github.com/akka/akka/issues/21849

        Returns:
        (undocumented)
      • deflate

        public Flow<ByteString,​ByteString,​NotUsed> deflate​(int level,
                                                                       boolean nowrap)
        Same as deflate() with configurable level and nowrap

        Parameters:
        level - Compression level (0-9)
        nowrap - if true then use GZIP compatible compression

        Returns:
        (undocumented)
      • inflate

        public Flow<ByteString,​ByteString,​NotUsed> inflate​(int maxBytesPerChunk)
        Creates a Flow that decompresses a deflate-compressed stream of data.

        Parameters:
        maxBytesPerChunk - Maximum length of an output ByteString chunk.
        Returns:
        (undocumented)
      • inflate

        public 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 output ByteString chunk.
        nowrap - if true then use GZIP compatible decompression
        Returns:
        (undocumented)
      • inflate$default$1

        public int inflate$default$1()