Fix #29. Need to recreate native libraries for all OSes
This commit is contained in:
parent
171775e92b
commit
fed7278fcd
|
@ -270,6 +270,19 @@ JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressed
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressedBuffer__JJJ
|
||||||
|
(JNIEnv * env, jobject self, jlong inputAddr, jlong offset, jlong length)
|
||||||
|
{
|
||||||
|
if(inputAddr == 0) {
|
||||||
|
// out of memory
|
||||||
|
throw_exception(env, self, 4);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
bool ret = snappy::IsValidCompressedBuffer((char*) (inputAddr + offset), (size_t) length);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_xerial_snappy_SnappyNative_arrayCopy
|
JNIEXPORT void JNICALL Java_org_xerial_snappy_SnappyNative_arrayCopy
|
||||||
(JNIEnv * env, jobject self, jobject input, jint offset, jint length, jobject output, jint output_offset)
|
(JNIEnv * env, jobject self, jobject input, jint offset, jint length, jobject output, jint output_offset)
|
||||||
{
|
{
|
||||||
|
|
|
@ -111,6 +111,14 @@ JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressed
|
||||||
JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressedBuffer__Ljava_lang_Object_2II
|
JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressedBuffer__Ljava_lang_Object_2II
|
||||||
(JNIEnv *, jobject, jobject, jint, jint);
|
(JNIEnv *, jobject, jobject, jint, jint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_xerial_snappy_SnappyNative
|
||||||
|
* Method: isValidCompressedBuffer
|
||||||
|
* Signature: (JJJ)Z
|
||||||
|
*/
|
||||||
|
JNIEXPORT jboolean JNICALL Java_org_xerial_snappy_SnappyNative_isValidCompressedBuffer__JJJ
|
||||||
|
(JNIEnv *, jobject, jlong, jlong, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: org_xerial_snappy_SnappyNative
|
* Class: org_xerial_snappy_SnappyNative
|
||||||
* Method: arrayCopy
|
* Method: arrayCopy
|
||||||
|
|
|
@ -76,6 +76,8 @@ public class SnappyNative
|
||||||
|
|
||||||
public native boolean isValidCompressedBuffer(Object input, int offset, int len) throws IOException;
|
public native boolean isValidCompressedBuffer(Object input, int offset, int len) throws IOException;
|
||||||
|
|
||||||
|
public native boolean isValidCompressedBuffer(long inputAddr, long offset, long len) throws IOException;
|
||||||
|
|
||||||
public native void arrayCopy(Object src, int offset, int byteLength, Object dest, int dOffset) throws IOException;
|
public native void arrayCopy(Object src, int offset, int byteLength, Object dest, int dOffset) throws IOException;
|
||||||
|
|
||||||
public void throw_error(int errorCode) throws IOException {
|
public void throw_error(int errorCode) throws IOException {
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue