public abstract class CompressionMethod
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static CompressionMethod |
NULL_COMPRESSION |
| Modifier | Constructor and Description |
|---|---|
protected |
CompressionMethod(java.lang.String name,
int id)
This constructor is called from a class which implements
a specific compression method.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
compress(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
Performs the compress operation.
|
protected abstract int |
decompress(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
Performs the decompress operation.
|
boolean |
equals(java.lang.Object o)
Compares this CompressionMethod with the given object.
|
static CompressionMethod[] |
getDefault()
Returns an array with the default compression methods.
|
int |
getID()
Returns the identifier of this compression method.
|
java.lang.String |
getName()
Returns the name of this compression method.
|
int |
hashCode()
Gets a hash code for this object.
|
java.lang.String |
toString()
Gets a String representation of this CompressionMethod.
|
public static final CompressionMethod NULL_COMPRESSION
protected CompressionMethod(java.lang.String name,
int id)
public final java.lang.String getName()
public final int getID()
protected abstract int compress(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
throws java.util.zip.DataFormatException
in - the byte array holding the data to be processedinOff - the offset indicating the start position within the in byte arrayinLen - the number of bytes to be processedout - the byte array for holding the resultoutOff - the offset indicating the start position within the out byte arrayjava.util.zip.DataFormatExceptionprotected abstract int decompress(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
throws java.util.zip.DataFormatException
in - the byte array holding the data to be processedinOff - the offset indicating the start position within the in byte arrayinLen - the number of bytes to be processedout - the byte array for holding the resultoutOff - the offset indicating the start position within the out byte arrayjava.util.zip.DataFormatExceptionpublic static CompressionMethod[] getDefault()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to be comparedtrue if the two objects are equal, false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object