Class GZIPCodec

java.lang.Object
org.igniterealtime.jbosh.GZIPCodec

final class GZIPCodec extends Object
Codec methods for compressing and uncompressing using GZIP.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    Size of the internal buffer when decoding.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Prevent construction.
  • Method Summary

    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 String
    Returns the name of the codec.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BUFFER_SIZE

      private static final int BUFFER_SIZE
      Size of the internal buffer when decoding.
      See Also:
  • Constructor Details

    • GZIPCodec

      private GZIPCodec()
      Prevent construction.
  • Method Details

    • getID

      public static 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 IOException
      Compress/encode the data provided using the GZIP format.
      Parameters:
      data - data to compress
      Returns:
      compressed data
      Throws:
      IOException - on compression failure
    • decode

      public static byte[] decode(byte[] compressed) throws IOException
      Uncompress/decode the data provided using the GZIP format.
      Parameters:
      data - data to uncompress
      Returns:
      uncompressed data
      Throws:
      IOException - on decompression failure