Class DeflateCompressor
java.lang.Object
org.apache.pekko.http.scaladsl.coding.Compressor
org.apache.pekko.http.scaladsl.coding.DeflateCompressor
- Direct Known Subclasses:
GzipCompressor
Internal API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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
deflater()
static org.apache.pekko.util.ByteString
drainDeflater
(Deflater deflater, byte[] buffer, org.apache.pekko.util.ByteStringBuilder result) final org.apache.pekko.util.ByteString
finish()
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
flush()
Flushes any output data and returns the currently remaining compressed data.protected org.apache.pekko.util.ByteString
flushWithBuffer
(byte[] buffer) static int
-
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
-
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 classCompressor
-
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 classCompressor
-
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. Useflush
orcompressAndFlush
to make sure that all input data has been compressed and pending output data has been returned.- Specified by:
compress
in classCompressor
- 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 classCompressor
- 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 classCompressor
- 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)
-