Class CompressionUtils

java.lang.Object
rs.baselib.util.CompressionUtils

public class CompressionUtils
extends java.lang.Object
Supports compression.
Author:
ralph
  • Constructor Summary

    Constructors 
    Constructor Description
    CompressionUtils()  
  • Method Summary

    Modifier and Type Method Description
    static byte[] compress​(byte[] data)
    Compresses a byte array .
    static byte[] decompress​(byte[] data)
    Uncompresses a byte array

    Methods inherited from class java.lang.Object

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

  • Method Details

    • compress

      public static byte[] compress​(byte[] data) throws java.io.IOException
      Compresses a byte array .
      Parameters:
      data - data to be compressed
      Returns:
      compressed version
      Throws:
      java.io.IOException - when compression fails
    • decompress

      public static byte[] decompress​(byte[] data) throws java.io.IOException, java.util.zip.DataFormatException
      Uncompresses a byte array
      Parameters:
      data - data to be uncompressed
      Returns:
      uncompressed version
      Throws:
      java.io.IOException - when uncompression fails
      java.util.zip.DataFormatException - if compression format is invalid