Class ZLibUtils

java.lang.Object
net.paulem.arcana.utils.ZLibUtils

public class ZLibUtils extends Object
Utility methods for compressing and decompressing byte arrays using the ZLIB algorithm.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    compress(byte[] data)
    Compresses the input byte array using the ZLIB compression algorithm.
    static byte[]
    decompress(byte[] data)
    Decompresses a given byte array that was compressed using the ZLIB compression algorithm.

    Methods inherited from class java.lang.Object

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

    • ZLibUtils

      public ZLibUtils()
  • Method Details

    • compress

      public static byte[] compress(byte[] data) throws IOException
      Compresses the input byte array using the ZLIB compression algorithm.
      Parameters:
      data - the byte array to be compressed
      Returns:
      a compressed byte array
      Throws:
      IOException - if an I/O error occurs during compression
    • decompress

      public static byte[] decompress(byte[] data) throws IOException
      Decompresses a given byte array that was compressed using the ZLIB compression algorithm.
      Parameters:
      data - the compressed byte array to be decompressed
      Returns:
      a decompressed byte array
      Throws:
      IOException - if an I/O error occurs during decompression