File: ZstdTest.java

package info (click to toggle)
zstd-jni-java 1.5.2-5%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: java: 2,246; ansic: 1,031; sh: 547; xml: 68; makefile: 21
file content (16 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import com.github.luben.zstd.Zstd;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;

public class ZstdTest {
  @Test
  public static void main(String[] args) {
    final String testString = "testing for Bazel in Debian";
    final byte[] testStringToBytes = testString.getBytes();
    final int originalSize = testStringToBytes.length;
    final byte[] testBytesCompressed = Zstd.compress(testStringToBytes);
    final byte[] testBytesDecompressed = Zstd.decompress(testBytesCompressed, originalSize);
    Assert.assertEquals(testString, new String(testBytesDecompressed));
  }
}