Package org.igniterealtime.jbosh
Class GZIPCodec
- java.lang.Object
-
- org.igniterealtime.jbosh.GZIPCodec
-
final class GZIPCodec extends java.lang.ObjectCodec methods for compressing and uncompressing using GZIP.
-
-
Field Summary
Fields Modifier and Type Field Description private static intBUFFER_SIZESize of the internal buffer when decoding.
-
Constructor Summary
Constructors Modifier Constructor Description privateGZIPCodec()Prevent construction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]decode(byte[] compressed)Uncompress/decode the data provided using the GZIP format.static byte[]encode(byte[] data)Compress/encode the data provided using the GZIP format.static java.lang.StringgetID()Returns the name of the codec.
-
-
-
Field Detail
-
BUFFER_SIZE
private static final int BUFFER_SIZE
Size of the internal buffer when decoding.- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
public static java.lang.String getID()
Returns the name of the codec.- Returns:
- string name of the codec (i.e., "gzip")
-
encode
public static byte[] encode(byte[] data) throws java.io.IOExceptionCompress/encode the data provided using the GZIP format.- Parameters:
data- data to compress- Returns:
- compressed data
- Throws:
java.io.IOException- on compression failure
-
decode
public static byte[] decode(byte[] compressed) throws java.io.IOExceptionUncompress/decode the data provided using the GZIP format.- Parameters:
data- data to uncompress- Returns:
- uncompressed data
- Throws:
java.io.IOException- on decompression failure
-
-