Class LZBDecompression
java.lang.Object
com.github.tommyettinger.textra.utils.LZBDecompression
Decompresses byte arrays to Strings using a type of LZ-compression.
This is the counterpart to
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.
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 TypeMethodDescriptionstatic 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.
-
Method Details
-
decompressFromBytes
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
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
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 LZBoffset
- where to start reading in compressedByteslength
- how many bytes to read from compressedBytes- Returns:
- the String that was originally given to be compressed
-