File: ZstdTest.java

package info (click to toggle)
zstd-jni-java 1.5.4-2%2Bds-3~exp4
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 544 kB
  • sloc: java: 2,422; ansic: 1,078; 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));
  }
}