Class ByteStringEncoding

java.lang.Object
com.github.yellowstonegames.core.ByteStringEncoding

public final class ByteStringEncoding extends Object
A variant on LZSEncoding to encode byte arrays to compressed Strings, and decode them back. This always uses UTF-16-safe encoding, which means it does not use one bit of each char in the compressed Strings but makes sure the Strings are valid UTF-16 (so they can be written to and read from file more safely).
Like almost all of SquidSquad, this class is not thread-safe. It reuses internal data structures rather than repeatedly re-creating them, which strongly helps its single-threaded performance.
  • Method Details

    • compress

      public static String compress(byte[] uncompressed)
    • decompress

      public static byte[] decompress(String compressed)