Skip to content

Commit 6d8f2ca

Browse files
committed
ci
1 parent b671455 commit 6d8f2ca

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ jobs:
107107
- uses: actions/upload-artifact@v3
108108
with:
109109
name: blosc-jar
110-
path: target/*.jar
110+
path: target/*.jar

src/main/java/dev/zarr/bloscjava/Blosc.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.InputStream;
66
import java.nio.file.Files;
77
import java.nio.file.StandardCopyOption;
8+
import java.util.Arrays;
89

910
public class Blosc {
1011
static {
@@ -15,6 +16,18 @@ public class Blosc {
1516
}
1617
}
1718

19+
public static void main(String[] args) {
20+
byte[] buf = new byte[256];
21+
for (int i = 0; i < buf.length; i++) buf[i] = (byte) (i % 12);
22+
23+
byte[] compBuf = Blosc.compress(buf, 1, Blosc.Compressor.ZSTD, 9);
24+
System.out.println(compBuf.length);
25+
26+
byte[] decompBuf = Blosc.decompress(compBuf);
27+
28+
System.out.println(Arrays.equals(buf, decompBuf));
29+
}
30+
1831
public static byte[] compress(byte[] src, int typeSize, Compressor compressor, int compressorLevel, Shuffle shuffle, int blockSize, int numThreads) {
1932
return _compress(src, typeSize, compressorLevel, shuffle.value(), blockSize, compressor.value(), numThreads);
2033
}

0 commit comments

Comments
 (0)