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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic interfacestatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Return the codec to the pool.booleancompress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options) Compress the in buffer to the out buffer.voiddecompress(ByteBuffer in, ByteBuffer out) Decompress the in buffer to the out buffer.voiddestroy()Closes the codec, releasing the resources.Get the default options for this codec.getKind()Get the compression kind.voidreset()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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-