Class LZBDecompression

java.lang.Object
com.github.tommyettinger.textra.utils.LZBDecompression

public final class LZBDecompression extends Object
Decompresses byte arrays to Strings using a type of LZ-compression. This is the counterpart to LZBCompression.
This is loosely based on LZ-String. The LZ-String algorithm was formulated by pieroxy. This was loosely based on a port/optimization attempt on another port (to Java), LZString4Java By Rufus Huang.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    decompressFromByteArray(com.badlogic.gdx.utils.ByteArray compressedBytes)
    Decompresses a libGDX ByteArray compressed with LZB, getting the original String back that was given to a compression method.
    static String
    decompressFromBytes(byte[] compressedBytes)
    Decompresses a byte array compressed with LZB, getting the original String back that was given to a compression method.
    static String
    decompressFromBytes(byte[] compressedBytes, int offset, int length)
    Decompresses a byte array compressed with LZB, getting the original String back that was given to a compression method.

    Methods inherited from class java.lang.Object

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

    • decompressFromBytes

      public static String decompressFromBytes(byte[] compressedBytes)
      Decompresses a byte array compressed with LZB, getting the original String back that was given to a compression method.
      Parameters:
      compressedBytes - a byte array compressed with LZB
      Returns:
      the String that was originally given to be compressed
    • decompressFromByteArray

      public static String decompressFromByteArray(com.badlogic.gdx.utils.ByteArray compressedBytes)
      Decompresses a libGDX ByteArray compressed with LZB, getting the original String back that was given to a compression method.
      Parameters:
      compressedBytes - a libGDX ByteArray compressed with LZB
      Returns:
      the String that was originally given to be compressed
    • decompressFromBytes

      public static String decompressFromBytes(byte[] compressedBytes, int offset, int length)
      Decompresses a byte array compressed with LZB, getting the original String back that was given to a compression method.
      Parameters:
      compressedBytes - a byte array compressed with LZB
      offset - where to start reading in compressedBytes
      length - how many bytes to read from compressedBytes
      Returns:
      the String that was originally given to be compressed