iaik.security.ssl
Class CompressionMethod

java.lang.Object
  extended by iaik.security.ssl.CompressionMethod
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NullCompression

public abstract class CompressionMethod
extends java.lang.Object
implements java.io.Serializable

Defines the compression methods supported in SSL Version 3.0. SSL v3.0 does not define any standard compression methods but allows user defined compression methods.

See Also:
Serialized Form

Field Summary
static CompressionMethod NULL_COMPRESSION
           
 
Constructor Summary
protected CompressionMethod(java.lang.String name, int id)
          This constructor is called from a class which implements a specific compression method.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_COMPRESSION

public static final CompressionMethod NULL_COMPRESSION
Constructor Detail

CompressionMethod

protected CompressionMethod(java.lang.String name,
                            int id)
This constructor is called from a class which implements a specific compression method.

Method Detail

getName

public final java.lang.String getName()
Returns the name of this compression method.

Returns:
the name of this compression method

getID

public final int getID()
Returns the identifier of this compression method.

Returns:
the identifier of this compression method

compress

protected abstract int compress(byte[] in,
                                int inOff,
                                int inLen,
                                byte[] out,
                                int outOff)
                         throws java.util.zip.DataFormatException
Performs the compress operation. Implemented by a subclass.

Parameters:
in - the byte array holding the data to be processed
inOff - the offset indicating the start position within the in byte array
inLen - the number of bytes to be processed
out - the byte array for holding the result
outOff - the offset indicating the start position within the out byte array
Returns:
the number of bytes that are stored in the out byte array
Throws:
java.util.zip.DataFormatException

decompress

protected abstract int decompress(byte[] in,
                                  int inOff,
                                  int inLen,
                                  byte[] out,
                                  int outOff)
                           throws java.util.zip.DataFormatException
Performs the decompress operation. Implemented by a subclass.

Parameters:
in - the byte array holding the data to be processed
inOff - the offset indicating the start position within the in byte array
inLen - the number of bytes to be processed
out - the byte array for holding the result
outOff - the offset indicating the start position within the out byte array
Returns:
the number of bytes that are stored in the out byte array
Throws:
java.util.zip.DataFormatException

getDefault

public static CompressionMethod[] getDefault()
Returns an array with the default compression methods. Currently this is always an array with NullCompression as its only element.

Returns:
an array with the default compression methods

equals

public boolean equals(java.lang.Object o)
Compares this CompressionMethod with the given object.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to be compared
Returns:
true if the two objects are equal, false otherwise

hashCode

public int hashCode()
Gets a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

toString

public java.lang.String toString()
Gets a String representation of this CompressionMethod.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this CompressionMethod

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC