Top Description Constructors Methods
org.apache.avro.file

public abstract Class Codec

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.avro.file.DeflateCodec, org.apache.avro.file.NullCodec, org.apache.avro.file.SnappyCodec, org.apache.avro.file.XZCodec, org.apache.avro.file.ZstandardCodec, org.apache.avro.file.BZip2Codec
Imports
java.io.IOException, java.nio.ByteBuffer

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract ByteBuffer
compress(ByteBuffer uncompressedData)

Compresses the input data

protected static int
public abstract ByteBuffer
decompress(ByteBuffer compressedData)

Decompress the data

public abstract boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Codecs must implement an equals() method.
public abstract String
getName()

Name of the codec; written to the file's metadata.

public abstract int
hashCode()

Overrides java.lang.Object.hashCode.

Codecs must implement a hashCode() method that is consistent with equals().
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Constructor Detail

Codecback to summary
public Codec()

Method Detail

compressback to summary
public abstract ByteBuffer compress(ByteBuffer uncompressedData) throws IOException

Compresses the input data

computeOffsetback to summary
protected static int computeOffset(ByteBuffer data)
decompressback to summary
public abstract ByteBuffer decompress(ByteBuffer compressedData) throws IOException

Decompress the data

equalsback to summary
public abstract boolean equals(Object other)

Overrides java.lang.Object.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

Parameters
other:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getNameback to summary
public abstract String getName()

Name of the codec; written to the file's metadata.

hashCodeback to summary
public abstract int hashCode()

Overrides java.lang.Object.hashCode.

Codecs must implement a hashCode() method that is consistent with equals().

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override