Package org.apache.avro.file
Class Codec
java.lang.Object
org.apache.avro.file.Codec
- Direct Known Subclasses:
BZip2Codec
,DeflateCodec
,SnappyCodec
,XZCodec
,ZstandardCodec
Interface for Avro-supported compression codecs for data files.
Note that Codec objects may maintain internal state (e.g. buffers) and are
not thread safe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ByteBuffer
compress
(ByteBuffer uncompressedData) Compresses the input dataprotected static int
computeOffset
(ByteBuffer data) abstract ByteBuffer
decompress
(ByteBuffer compressedData) Decompress the dataabstract boolean
Codecs must implement an equals() method.abstract String
getName()
Name of the codec; written to the file's metadata.abstract int
hashCode()
Codecs must implement a hashCode() method that is consistent with equals().toString()
-
Constructor Details
-
Codec
public Codec()
-
-
Method Details
-
getName
Name of the codec; written to the file's metadata. -
compress
Compresses the input data- Throws:
IOException
-
decompress
Decompress the data- Throws:
IOException
-
equals
Codecs must implement an equals() method. Two codecs, A and B are equal if: the result of A and B decompressing content compressed by A is the same AND the result of A and B decompressing content compressed by B is the same -
hashCode
public abstract int hashCode()Codecs must implement a hashCode() method that is consistent with equals(). -
toString
-
computeOffset
-