public interface ICompressor extends Serializable
| Modifier and Type | Interface and Description |
|---|---|
static class |
ICompressor.GZIPCompress |
static class |
ICompressor.GZIPCompressor |
static class |
ICompressor.IOTDBLZ4Compressor |
static class |
ICompressor.NoCompressor
NoCompressor will do nothing for data and return the input data directly.
|
static class |
ICompressor.SnappyCompressor |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
compress(byte[] data) |
byte[] |
compress(byte[] data,
int offset,
int length)
abstract method of compress.
|
int |
compress(byte[] data,
int offset,
int length,
byte[] compressed)
abstract method of compress.
|
int |
compress(ByteBuffer data,
ByteBuffer compressed)
If the data is large, this function is better than byte[].
|
static ICompressor |
getCompressor(CompressionType name)
get Compressor according to CompressionType.
|
static ICompressor |
getCompressor(String name) |
int |
getMaxBytesForCompression(int uncompressedDataSize)
Get the maximum byte size needed for compressing data of the given byte size.
|
CompressionType |
getType() |
static ICompressor getCompressor(String name)
static ICompressor getCompressor(CompressionType name)
name - CompressionTypebyte[] compress(byte[] data)
throws IOException
IOExceptionbyte[] compress(byte[] data,
int offset,
int length)
throws IOException
IOExceptionint compress(byte[] data,
int offset,
int length,
byte[] compressed)
throws IOException
IOExceptionint compress(ByteBuffer data, ByteBuffer compressed) throws IOException
data - MUST be DirectByteBuffer for Snappy.compressed - MUST be DirectByteBuffer for Snappy.IOExceptionint getMaxBytesForCompression(int uncompressedDataSize)
GZIPCompressOverflowExceptionuncompressedDataSize - byte size of the data to compressCompressionType getType()
Copyright © 2022 The Apache Software Foundation. All rights reserved.