Interface Compressor


@ThreadSafe public interface Compressor
A service provider interface (SPI) for compression. Implementation MUST be thread safe as the same instance is expected to be used many times and concurrently.
Since:
1.59.0
  • Method Summary

    Modifier and Type
    Method
    Description
    compress(OutputStream outputStream)
    Wrap the outputStream with a compressing output stream.
    The name of the compressor encoding.
  • Method Details

    • getEncoding

      String getEncoding()
      The name of the compressor encoding.

      Used to identify the compressor during configuration and to populate the Content-Encoding header.

    • compress

      OutputStream compress(OutputStream outputStream) throws IOException
      Wrap the outputStream with a compressing output stream.
      Throws:
      IOException