Package org.apache.iotdb.tsfile.compress
Interface IUnCompressor
-
- All Known Implementing Classes:
IUnCompressor.GZIPUnCompressor,IUnCompressor.LZ4UnCompressor,IUnCompressor.LZMA2UnCompressor,IUnCompressor.NoUnCompressor,IUnCompressor.SnappyUnCompressor,IUnCompressor.ZstdUnCompressor
public interface IUnCompressoruncompress data according to type in metadata.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIUnCompressor.GZIPUnCompressorstatic classIUnCompressor.LZ4UnCompressorstatic classIUnCompressor.LZMA2UnCompressorstatic classIUnCompressor.NoUnCompressorstatic classIUnCompressor.SnappyUnCompressorstatic classIUnCompressor.ZstdUnCompressor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description CompressionTypegetCodecName()intgetUncompressedLength(byte[] array, int offset, int length)intgetUncompressedLength(java.nio.ByteBuffer buffer)get the uncompressed length.static IUnCompressorgetUnCompressor(CompressionType name)get the UnCompressor based on the CompressionType.byte[]uncompress(byte[] byteArray)uncompress the byte array.intuncompress(byte[] byteArray, int offset, int length, byte[] output, int outOffset)uncompress the byte array.intuncompress(java.nio.ByteBuffer compressed, java.nio.ByteBuffer uncompressed)if the data is large, using this function is better.
-
-
-
Method Detail
-
getUnCompressor
static IUnCompressor getUnCompressor(CompressionType name)
get the UnCompressor based on the CompressionType.- Parameters:
name- CompressionType- Returns:
- the UnCompressor of specified CompressionType
-
getUncompressedLength
int getUncompressedLength(byte[] array, int offset, int length) throws java.io.IOException- Throws:
java.io.IOException
-
getUncompressedLength
int getUncompressedLength(java.nio.ByteBuffer buffer) throws java.io.IOExceptionget the uncompressed length.- Parameters:
buffer- MUST be DirectByteBuffer- Throws:
java.io.IOException
-
uncompress
byte[] uncompress(byte[] byteArray) throws java.io.IOExceptionuncompress the byte array.- Parameters:
byteArray- to be uncompressed bytes- Returns:
- bytes after uncompressed
- Throws:
java.io.IOException
-
uncompress
int uncompress(byte[] byteArray, int offset, int length, byte[] output, int outOffset) throws java.io.IOExceptionuncompress the byte array.- Parameters:
byteArray- -to be uncompressed bytesoffset- -offsetlength- -lengthoutput- -output byteoutOffset- -- Returns:
- the valid length of the output array
- Throws:
java.io.IOException
-
uncompress
int uncompress(java.nio.ByteBuffer compressed, java.nio.ByteBuffer uncompressed) throws java.io.IOExceptionif the data is large, using this function is better.- Parameters:
compressed- MUST be DirectByteBufferuncompressed- MUST be DirectByteBuffer- Throws:
java.io.IOException
-
getCodecName
CompressionType getCodecName()
-
-