Skip to content

Commit

Permalink
Add functions to inspect min/max supported compression levels
Browse files Browse the repository at this point in the history
as suggested by @svladykin in #80
  • Loading branch information
luben committed Oct 24, 2018
1 parent 6f31a41 commit 4b0396f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/com/github/luben/zstd/Zstd.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ public static long trainFromBufferDirect(ByteBuffer samples, int[] sampleSizes,
public static native int frameHeaderSizeMin();
public static native int frameHeaderSizeMax();
public static native int blockSizeMax();
/* Min/max compression levels */
public static native int minCompressionLevel();
public static native int maxCompressionLevel();

/* Convenience methods */

Expand Down
10 changes: 10 additions & 0 deletions src/main/native/jni_zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,13 @@ JNIEXPORT jint JNICALL Java_com_github_luben_zstd_Zstd_blockSizeMax
(JNIEnv *env, jclass obj) {
return ZSTD_BLOCKSIZE_MAX;
}

JNIEXPORT jint JNICALL Java_com_github_luben_zstd_Zstd_minCompressionLevel
(JNIEnv *env, jclass obj) {
return ZSTD_minCLevel();
}

JNIEXPORT jint JNICALL Java_com_github_luben_zstd_Zstd_maxCompressionLevel
(JNIEnv *env, jclass obj) {
return ZSTD_maxCLevel();
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.7-1
1.3.7-2

0 comments on commit 4b0396f

Please sign in to comment.