Interface CompressionCodec

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
DirectDecompressionCodec
All Known Implementing Classes:
AircompressorCodec, BrotliCodec, SnappyCodec, ZlibCodec, ZstdCodec

public interface CompressionCodec extends Closeable
The API for compression codecs for ORC. Closeable.close() returns this codec to the OrcCodecPool.
  • Method Details

    • getDefaultOptions

      CompressionCodec.Options getDefaultOptions()
      Get the default options for this codec.
      Returns:
      the default options object
    • compress

      boolean compress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options) throws IOException
      Compress the in buffer to the out buffer.
      Parameters:
      in - the bytes to compress
      out - the compressed bytes
      overflow - put any additional bytes here
      options - the options to control compression
      Returns:
      true if the output is smaller than input
      Throws:
      IOException
    • decompress

      void decompress(ByteBuffer in, ByteBuffer out) throws IOException
      Decompress the in buffer to the out buffer.
      Parameters:
      in - the bytes to decompress
      out - the decompressed bytes
      Throws:
      IOException
    • reset

      void reset()
      Resets the codec, preparing it for reuse.
    • destroy

      void destroy()
      Closes the codec, releasing the resources.
    • getKind

      CompressionKind getKind()
      Get the compression kind.
    • close

      void close()
      Return the codec to the pool.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable