Class DeflateCompressor

java.lang.Object
org.apache.pekko.http.scaladsl.coding.Compressor
org.apache.pekko.http.scaladsl.coding.DeflateCompressor
Direct Known Subclasses:
GzipCompressor

public class DeflateCompressor extends Compressor
Internal API
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DeflateCompressor(int compressionLevel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.apache.pekko.util.ByteString
    compress(org.apache.pekko.util.ByteString input)
    Compresses the given input and returns compressed data.
    final org.apache.pekko.util.ByteString
    compressAndFinish(org.apache.pekko.util.ByteString input)
    Combines `compress` + `finish`
    final org.apache.pekko.util.ByteString
    compressAndFlush(org.apache.pekko.util.ByteString input)
    Combines `compress` + `flush`
    protected org.apache.pekko.util.ByteString
    compressWithBuffer(org.apache.pekko.util.ByteString input, byte[] buffer)
     
    static int
     
    protected Deflater
     
    static org.apache.pekko.util.ByteString
    drainDeflater(Deflater deflater, byte[] buffer, org.apache.pekko.util.ByteStringBuilder result)
     
    final org.apache.pekko.util.ByteString
    Closes this compressed stream and return the remaining compressed data.
    protected org.apache.pekko.util.ByteString
    finishWithBuffer(byte[] buffer)
     
    final org.apache.pekko.util.ByteString
    Flushes any output data and returns the currently remaining compressed data.
    protected org.apache.pekko.util.ByteString
    flushWithBuffer(byte[] buffer)
     
    static int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeflateCompressor

      public DeflateCompressor(int compressionLevel)
    • DeflateCompressor

      public DeflateCompressor()
  • Method Details

    • MinBufferSize

      public static int MinBufferSize()
    • DefaultCompressionLevel

      public static int DefaultCompressionLevel()
    • drainDeflater

      public static org.apache.pekko.util.ByteString drainDeflater(Deflater deflater, byte[] buffer, org.apache.pekko.util.ByteStringBuilder result)
    • deflater

      protected Deflater deflater()
    • compressAndFlush

      public final org.apache.pekko.util.ByteString compressAndFlush(org.apache.pekko.util.ByteString input)
      Description copied from class: Compressor
      Combines `compress` + `flush`
      Specified by:
      compressAndFlush in class Compressor
    • compressAndFinish

      public final org.apache.pekko.util.ByteString compressAndFinish(org.apache.pekko.util.ByteString input)
      Description copied from class: Compressor
      Combines `compress` + `finish`
      Specified by:
      compressAndFinish in class Compressor
    • compress

      public final org.apache.pekko.util.ByteString compress(org.apache.pekko.util.ByteString input)
      Description copied from class: Compressor
      Compresses the given input and returns compressed data. The implementation can and will choose to buffer output data to improve compression. Use flush or compressAndFlush to make sure that all input data has been compressed and pending output data has been returned.
      Specified by:
      compress in class Compressor
      Parameters:
      input - (undocumented)
      Returns:
      (undocumented)
    • flush

      public final org.apache.pekko.util.ByteString flush()
      Description copied from class: Compressor
      Flushes any output data and returns the currently remaining compressed data.
      Specified by:
      flush in class Compressor
      Returns:
      (undocumented)
    • finish

      public final org.apache.pekko.util.ByteString finish()
      Description copied from class: Compressor
      Closes this compressed stream and return the remaining compressed data. After calling this method, this Compressor cannot be used any further.
      Specified by:
      finish in class Compressor
      Returns:
      (undocumented)
    • compressWithBuffer

      protected org.apache.pekko.util.ByteString compressWithBuffer(org.apache.pekko.util.ByteString input, byte[] buffer)
    • flushWithBuffer

      protected org.apache.pekko.util.ByteString flushWithBuffer(byte[] buffer)
    • finishWithBuffer

      protected org.apache.pekko.util.ByteString finishWithBuffer(byte[] buffer)