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

org.apache.cassandra.io.compress

## Class LZ4Compressor

- java.lang.Object
- - org.apache.cassandra.io.compress.LZ4Compressor

- All Implemented Interfaces:
    ICompressor

      public class LZ4Compressor
      extends java.lang.Object
      implements ICompressor

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static LZ4Compressor` | `instance`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compress(java.nio.ByteBuffer input, java.nio.ByteBuffer output)` Compression for ByteBuffers.
    `static LZ4Compressor` | `create(java.util.Map<java.lang.String,java.lang.String> args)`
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### instance

          public static final LZ4Compressor instance

  - ### Method Detail

    - #### create

          public static LZ4Compressor create(java.util.Map<java.lang.String,java.lang.String> args)

    - #### initialCompressedBufferLength

          public int initialCompressedBufferLength(int chunkLength)

      Specified by:
        `initialCompressedBufferLength` in interface `ICompressor`

    - #### compress

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

      Description copied from interface: `ICompressor`
      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.
      Specified by:
        `compress` in interface `ICompressor`
      Throws:
        `java.io.IOException`

    - #### uncompress

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

      Specified by:
        `uncompress` in interface `ICompressor`
      Throws:
        `java.io.IOException`

    - #### uncompress

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

      Description copied from interface: `ICompressor`
      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.
      Specified by:
        `uncompress` in interface `ICompressor`
      Throws:
        `java.io.IOException`

    - #### supportedOptions

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

      Specified by:
        `supportedOptions` in interface `ICompressor`

    - #### preferredBufferType

          public BufferType preferredBufferType()

      Description copied from interface: `ICompressor`
      Returns the preferred (most efficient) buffer type for this compressor.
      Specified by:
        `preferredBufferType` in interface `ICompressor`

    - #### supports

          public boolean supports(BufferType bufferType)

      Description copied from interface: `ICompressor`
      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.
      Specified by:
        `supports` in interface `ICompressor`

Copyright © 2018 The Apache Software Foundation