public class ZstdCompressor extends java.lang.Object implements ICompressor
ICompressor.Uses
Modifier and Type | Field and Description |
---|---|
static int |
BEST_COMPRESSION_LEVEL |
static java.lang.String |
COMPRESSION_LEVEL_OPTION_NAME |
static int |
DEFAULT_COMPRESSION_LEVEL |
static int |
FAST_COMPRESSION_LEVEL |
Modifier and Type | Method and Description |
---|---|
void |
compress(java.nio.ByteBuffer input,
java.nio.ByteBuffer output)
Compress using ByteBuffers
|
static ZstdCompressor |
create(java.util.Map<java.lang.String,java.lang.String> options)
Create a Zstd compressor with the given options
|
int |
getCompressionLevel() |
static ZstdCompressor |
getOrCreate(int level)
Get a cached instance or return a new one
|
int |
initialCompressedBufferLength(int chunkLength)
Get initial compressed buffer length
|
BufferType |
preferredBufferType()
Return the preferred BufferType
|
java.util.Set<ICompressor.Uses> |
recommendedUses()
Hints to Cassandra which uses this compressor is recommended for.
|
java.util.Set<java.lang.String> |
supportedOptions()
Lists the supported options by this compressor
|
boolean |
supports(BufferType bufferType)
Check whether the given BufferType is supported
|
int |
uncompress(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset)
Decompress data using arrays
|
void |
uncompress(java.nio.ByteBuffer input,
java.nio.ByteBuffer output)
Decompress data via ByteBuffers
|
public static final int FAST_COMPRESSION_LEVEL
public static final int BEST_COMPRESSION_LEVEL
public static final int DEFAULT_COMPRESSION_LEVEL
public static final java.lang.String COMPRESSION_LEVEL_OPTION_NAME
public static ZstdCompressor create(java.util.Map<java.lang.String,java.lang.String> options)
options
- public static ZstdCompressor getOrCreate(int level)
level
- public int initialCompressedBufferLength(int chunkLength)
initialCompressedBufferLength
in interface ICompressor
chunkLength
- public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws java.io.IOException
uncompress
in interface ICompressor
input
- inputOffset
- inputLength
- output
- outputOffset
- java.io.IOException
public void uncompress(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws java.io.IOException
uncompress
in interface ICompressor
input
- output
- java.io.IOException
public void compress(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws java.io.IOException
compress
in interface ICompressor
input
- output
- java.io.IOException
public BufferType preferredBufferType()
preferredBufferType
in interface ICompressor
public boolean supports(BufferType bufferType)
supports
in interface ICompressor
bufferType
- public java.util.Set<java.lang.String> supportedOptions()
supportedOptions
in interface ICompressor
public int getCompressionLevel()
public java.util.Set<ICompressor.Uses> recommendedUses()
ICompressor
recommendedUses
in interface ICompressor
Copyright © 2009- The Apache Software Foundation