Class Compressor

java.lang.Object
com.semedy.reasoner.utils.Compressor

public class Compressor extends Object
Provides methods for compressing and decompressing byte arrays
Author:
angele
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    compressGZIP(byte[] data, int off, int len)
    Compress data out of a byte array at offset off and length len
    byte[]
    compressLZ4(byte[] data)
    Compress in LZ4
    byte[]
    decompressGZIP(byte[] data, int originallength)
    Decompress gzipped data
    void
    decompressLZ4(byte[] compressedData, byte[] restored)
    Decompress LZ4
    byte[]
    decompressLZ4(byte[] compressedData, int originallength)
    Decompress LZ4

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Compressor

      public Compressor()
  • Method Details

    • decompressGZIP

      public byte[] decompressGZIP(byte[] data, int originallength) throws IOException
      Decompress gzipped data
      Parameters:
      data - , data to be decompressed
      originallength - , the length of uncompressed data
      Returns:
      decompressed data
      Throws:
      IOException
    • compressLZ4

      public byte[] compressLZ4(byte[] data) throws IOException
      Compress in LZ4
      Parameters:
      data - , data
      Returns:
      compressed data
      Throws:
      IOException
    • decompressLZ4

      public byte[] decompressLZ4(byte[] compressedData, int originallength) throws IOException
      Decompress LZ4
      Parameters:
      compressedData - , array containing compressed data
      originallength - , the length of uncompressed data
      Returns:
      decompressed data
      Throws:
      IOException
    • decompressLZ4

      public void decompressLZ4(byte[] compressedData, byte[] restored) throws IOException
      Decompress LZ4
      Parameters:
      compressedData - , array containing compressed data
      originallength - , the length of uncompressed data
      Throws:
      IOException
    • compressGZIP

      public byte[] compressGZIP(byte[] data, int off, int len) throws IOException
      Compress data out of a byte array at offset off and length len
      Parameters:
      data - , data
      off - , offset in data
      len - , number of bytes to compress
      Returns:
      compressed data
      Throws:
      IOException