Class XZCodec

  • All Implemented Interfaces:
    ICodec

    public class XZCodec
    extends AbstractCodec
    Converts byte[] -> byte[] in both directions.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CODEC_ID
      The gzip codec id.
    • Constructor Summary

      Constructors 
      Constructor Description
      XZCodec()
      Create a new codec.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] decode​(byte[] bytes, int offset, int length)
      Decode bytes.
      byte[] decode​(java.lang.Object bytes)
      Decode an object.
      static byte[] decodeBytes​(byte[] bytes, int offset, int length)
      Decode bytes.
      static byte[] decodeBytes​(java.io.ByteArrayInputStream bais)
      Decode bytes.
      byte[] encode​(byte[] val)
      Encode an object.
      static byte[] encodeBytes​(byte[] val)
      Encode an object.
      int getCodecId()
      Get the codec id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XZCodec

        public XZCodec()
        Create a new codec.
    • Method Detail

      • getCodecId

        public int getCodecId()
        Get the codec id.
        Returns:
        The codec id.
      • encode

        public byte[] encode​(byte[] val)
        Encode an object.
        Parameters:
        obj - The object.
        Returns:
        The encoded object.
        Throws:
        java.io.IOException
      • decode

        public byte[] decode​(java.lang.Object bytes)
        Decode an object.
        Returns:
        The decoded object.
        Throws:
        java.io.IOException
      • decode

        public byte[] decode​(byte[] bytes,
                             int offset,
                             int length)
        Decode bytes.
        Parameters:
        bytes - The value bytes as byte array or input stream.
        Returns:
        The decoded bytes.
        Throws:
        java.io.IOException
      • encodeBytes

        public static byte[] encodeBytes​(byte[] val)
        Encode an object.
        Parameters:
        obj - The object.
        Throws:
        java.io.IOException
      • decodeBytes

        public static byte[] decodeBytes​(byte[] bytes,
                                         int offset,
                                         int length)
        Decode bytes.
        Returns:
        The decoded bytes.
        Throws:
        java.io.IOException
      • decodeBytes

        public static byte[] decodeBytes​(java.io.ByteArrayInputStream bais)
        Decode bytes.
        Returns:
        The decoded bytes.
        Throws:
        java.io.IOException