Package org.igniterealtime.jbosh
Class ZLIBCodec
- java.lang.Object
-
- org.igniterealtime.jbosh.ZLIBCodec
-
final class ZLIBCodec extends java.lang.Object
Codec methods for compressing and uncompressing using ZLIB.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFFER_SIZE
Size of the internal buffer when decoding.
-
Constructor Summary
Constructors Modifier Constructor Description private
ZLIBCodec()
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 ZLIB format.static byte[]
encode(byte[] data)
Compress/encode the data provided using the ZLIB format.static java.lang.String
getID()
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., "deflate")
-
encode
public static byte[] encode(byte[] data) throws java.io.IOException
Compress/encode the data provided using the ZLIB 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.IOException
Uncompress/decode the data provided using the ZLIB format.- Parameters:
data
- data to uncompress- Returns:
- uncompressed data
- Throws:
java.io.IOException
- on decompression failure
-
-