Interface Compressor

All Known Implementing Classes:
DeflateCompressor

public interface Compressor
  • Method Details

    • isCompressed

      boolean isCompressed(BytesReference bytes)
    • headerLength

      int headerLength()
    • threadLocalInputStream

      InputStream threadLocalInputStream(InputStream in) throws IOException
      Creates a new input stream that decompresses the contents read from the provided input stream. Closing the returned InputStream will close the provided stream input. Note: The returned stream may only be used on the thread that created it as it might use thread-local resources and must be safely closed after use
      Throws:
      IOException
    • threadLocalOutputStream

      OutputStream threadLocalOutputStream(OutputStream out) throws IOException
      Creates a new output stream that compresses the contents and writes to the provided output stream. Closing the returned OutputStream will close the provided output stream. Note: The returned stream may only be used on the thread that created it as it might use thread-local resources and must be safely closed after use
      Throws:
      IOException
    • uncompress

      BytesReference uncompress(BytesReference bytesReference) throws IOException
      Decompress bytes into a newly allocated buffer.
      Parameters:
      bytesReference - bytes to decompress
      Returns:
      decompressed bytes
      Throws:
      IOException
    • compress

      BytesReference compress(BytesReference bytesReference) throws IOException
      Compress bytes into a newly allocated buffer.
      Parameters:
      bytesReference - bytes to compress
      Returns:
      compressed bytes
      Throws:
      IOException