CompressionCodec (ORC Core 1.6.5 API)
Date: 2020-10-01

org.apache.orc

## Interface CompressionCodec

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

      public interface CompressionCodec
      extends Closeable

  The API for compression codecs for ORC. Closeable.close() returns this codec to the OrcCodecPool.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `CompressionCodec.DataKind`
    `static interface` | `CompressionCodec.Options`
    `static class` | `CompressionCodec.SpeedModifier`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Return the codec to the pool.
    `boolean` | `compress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options)` Compress the in buffer to the out buffer.
    `void` | `decompress(ByteBuffer in, ByteBuffer out)` Decompress the in buffer to the out buffer.
    `void` | `destroy()` Closes the codec, releasing the resources.
    `CompressionCodec.Options` | `getDefaultOptions()` Get the default options for this codec.
    `CompressionKind` | `getKind()` Get the compression kind.
    `void` | `reset()` Resets the codec, preparing it for reuse.

- - ### Method Detail

    - #### 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`

Copyright © 2013–2020 The Apache Software Foundation. All rights reserved.