Package org.apache.avro.file
Class DeflateCodec
java.lang.Object
org.apache.avro.file.Codec
org.apache.avro.file.DeflateCodec
Implements DEFLATE (RFC1951) compression and decompression.
Note that there is a distinction between RFC1951 (deflate) and RFC1950
(zlib). zlib adds an extra 2-byte header at the front, and a 4-byte checksum
at the end. The code here, by passing "true" as the "nowrap" option to
Inflater
and Deflater
, is using RFC1951.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompress
(ByteBuffer data) Compresses the input datadecompress
(ByteBuffer data) Decompress the databoolean
Codecs must implement an equals() method.getName()
Name of the codec; written to the file's metadata.int
hashCode()
Codecs must implement a hashCode() method that is consistent with equals().toString()
Methods inherited from class org.apache.avro.file.Codec
computeOffset
-
Constructor Details
-
DeflateCodec
public DeflateCodec(int compressionLevel)
-
-
Method Details
-
getName
Description copied from class:Codec
Name of the codec; written to the file's metadata. -
compress
Description copied from class:Codec
Compresses the input data- Specified by:
compress
in classCodec
- Throws:
IOException
-
decompress
Description copied from class:Codec
Decompress the data- Specified by:
decompress
in classCodec
- Throws:
IOException
-
hashCode
public int hashCode()Description copied from class:Codec
Codecs must implement a hashCode() method that is consistent with equals(). -
equals
Description copied from class:Codec
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 -
toString
-