ICompressor (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.io.compress

## Interface ICompressor

- All Known Implementing Classes:
    DeflateCompressor, LZ4Compressor, SnappyCompressor

      public interface ICompressor

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compress(java.nio.ByteBuffer input, java.nio.ByteBuffer output)` Compression for ByteBuffers.
    `int` | `initialCompressedBufferLength(int chunkLength)`
    `BufferType` | `preferredBufferType()` Returns the preferred (most efficient) buffer type for this compressor.
    `java.util.Set<java.lang.String>` | `supportedOptions()`
    `boolean` | `supports(BufferType bufferType)` Checks if the given buffer would be supported by the compressor.
    `int` | `uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)`
    `void` | `uncompress(java.nio.ByteBuffer input, java.nio.ByteBuffer output)` Decompression for DirectByteBuffers.

- - ### Method Detail

    - #### initialCompressedBufferLength

          int initialCompressedBufferLength(int chunkLength)

    - #### uncompress

          int uncompress(byte[] input,
                         int inputOffset,
                         int inputLength,
                         byte[] output,
                         int outputOffset)
                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### compress

          void compress(java.nio.ByteBuffer input,
                        java.nio.ByteBuffer output)
                 throws java.io.IOException

      Compression for ByteBuffers. The data between input.position() and input.limit() is compressed and placed into output starting from output.position(). Positions in both buffers are moved to reflect the bytes read and written. Limits are not changed.
      Throws:
        `java.io.IOException`

    - #### uncompress

          void uncompress(java.nio.ByteBuffer input,
                          java.nio.ByteBuffer output)
                   throws java.io.IOException

      Decompression for DirectByteBuffers. The data between input.position() and input.limit() is uncompressed and placed into output starting from output.position(). Positions in both buffers are moved to reflect the bytes read and written. Limits are not changed.
      Throws:
        `java.io.IOException`

    - #### preferredBufferType

          BufferType preferredBufferType()

      Returns the preferred (most efficient) buffer type for this compressor.

    - #### supports

          boolean supports(BufferType bufferType)

      Checks if the given buffer would be supported by the compressor. If a type is supported the compressor must be able to use it in combination with all other supported types. Direct and memory-mapped buffers must be supported by all compressors.

    - #### supportedOptions

          java.util.Set<java.lang.String> supportedOptions()

Copyright © 2018 The Apache Software Foundation