com.github.davidmoten.jsmaz is a Java port of the Smaz short string compression algorithm by Salvatore Sanfilippo and released as a C library at: https://github.com/antirez/smaz. This Java port was built using https://github.com/RyanAD/jsmaz and https://github.com/tmbo/scala-smaz/.
Status: in development
Features
- supports UTF-8 character set
- good test coverage
- supports Java 8+
Add this to your pom.xml:
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>jsmaz</artifactId>
<version>VERSION_HERE</version>
</dependency>
String a = "this is a simple test";
// compress to 10 bytes
byte[] compressed = Smaz.compress(a);
// decompress, b will be the same as a
String b = Smaz.decompress(compressed);