Package org.apache.orc
Interface CompressionCodec
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Subinterfaces:
DirectDecompressionCodec
- All Known Implementing Classes:
AircompressorCodec
,BrotliCodec
,SnappyCodec
,ZlibCodec
,ZstdCodec
The API for compression codecs for ORC.
Closeable.close() returns this codec to the OrcCodecPool.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static interface
static enum
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Return the codec to the pool.boolean
compress
(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options) Compress the in buffer to the out buffer.void
decompress
(ByteBuffer in, ByteBuffer out) Decompress the in buffer to the out buffer.void
destroy()
Closes the codec, releasing the resources.Get the default options for this codec.getKind()
Get the compression kind.void
reset()
Resets the codec, preparing it for reuse.
-
Method Details
-
getDefaultOptions
CompressionCodec.Options getDefaultOptions()Get the default options for this codec.- Returns:
- the default options object
-
compress
boolean compress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options) throws IOException Compress the in buffer to the out buffer.- Parameters:
in
- the bytes to compressout
- the compressed bytesoverflow
- put any additional bytes hereoptions
- the options to control compression- Returns:
- true if the output is smaller than input
- Throws:
IOException
-
decompress
Decompress the in buffer to the out buffer.- Parameters:
in
- the bytes to decompressout
- the decompressed bytes- Throws:
IOException
-
reset
void reset()Resets the codec, preparing it for reuse. -
destroy
void destroy()Closes the codec, releasing the resources. -
getKind
CompressionKind getKind()Get the compression kind. -
close
void close()Return the codec to the pool.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-