Skip to content

markrileybot/heatshrink-java

Repository files navigation

heatshrink-java

Java library used to encode/decode heatshrink compressed data.

Building

./gradlew build

Gradle dependency

See https://search.maven.org/artifact/io.github.markrileybot/heatshrink-java/

Usage

Java library

int windowSize = 9;
int lookaheadSize = 8;
ByteArrayOutputStream baos = new ByteArrayOutputStream();

try(HsOutputStream out = new HsOutputStream(baos, windowSize, lookaheadSize)) {
	out.write("ABCABCABCABCABCABC".getBytes());
}

try(HsInputStream hsi = new HsInputStream(new ByteArrayInutStream(baos.toByteArray()), windowSize, lookaheadSize)) {
	byte[] res = new byte[512];
	int len = hsi.read(res);
	System.out.println(new String(res, 0, len));
}

CLI

$ java -jar heatshrink-java-exe.jar [-h] [-e|-d] [-v] [-w SIZE] [-l BITS] [IN_FILE] [OUT_FILE]

Status

Build Status Coverage Status Maven Central