diff --git a/src/main/java/org/xerial/snappy/LoadSnappy.java b/src/main/java/org/xerial/snappy/LoadSnappy.java index 10d3c6f..c17fd23 100755 --- a/src/main/java/org/xerial/snappy/LoadSnappy.java +++ b/src/main/java/org/xerial/snappy/LoadSnappy.java @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ //-------------------------------------- // snappy-java Project // diff --git a/src/main/java/org/xerial/snappy/Snappy.java b/src/main/java/org/xerial/snappy/Snappy.java index 329bc69..4c62d5a 100755 --- a/src/main/java/org/xerial/snappy/Snappy.java +++ b/src/main/java/org/xerial/snappy/Snappy.java @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ //-------------------------------------- // snappy-java Project // @@ -93,7 +108,7 @@ public class Snappy if (!compressed.isDirect()) throw new IllegalArgumentException("input is not a direct buffer"); - return SnappyNative.getUncompressedLength(compressed, compressed.position(), compressed.remaining()); + return SnappyNative.uncompressedLength(compressed, compressed.position(), compressed.remaining()); } /** diff --git a/src/main/java/org/xerial/snappy/SnappyNative.cpp b/src/main/java/org/xerial/snappy/SnappyNative.cpp index 3a69cd0..34b004d 100755 --- a/src/main/java/org/xerial/snappy/SnappyNative.cpp +++ b/src/main/java/org/xerial/snappy/SnappyNative.cpp @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ #include #include #include "SnappyNative.h" @@ -74,7 +89,7 @@ JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_maxCompressedLength * Method: getUncompressedLength * Signature: (Ljava/nio/ByteBuffer;)J */ -JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_getUncompressedLength +JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_uncompressedLength (JNIEnv * env, jclass self, jobject compressed, jint cpos, jint clen) { char* compressedBuffer = (char*) env->GetDirectBufferAddress(compressed) + cpos; diff --git a/src/main/java/org/xerial/snappy/SnappyNative.h b/src/main/java/org/xerial/snappy/SnappyNative.h index 6bc43e1..96ba375 100755 --- a/src/main/java/org/xerial/snappy/SnappyNative.h +++ b/src/main/java/org/xerial/snappy/SnappyNative.h @@ -41,10 +41,10 @@ JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_maxCompressedLength /* * Class: org_xerial_snappy_SnappyNative - * Method: getUncompressedLength + * Method: uncompressedLength * Signature: (Ljava/nio/ByteBuffer;II)I */ -JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_getUncompressedLength +JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_uncompressedLength (JNIEnv *, jclass, jobject, jint, jint); #ifdef __cplusplus diff --git a/src/main/java/org/xerial/snappy/SnappyNative.java b/src/main/java/org/xerial/snappy/SnappyNative.java index 943bc16..95b0821 100755 --- a/src/main/java/org/xerial/snappy/SnappyNative.java +++ b/src/main/java/org/xerial/snappy/SnappyNative.java @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ //-------------------------------------- // snappy-java Project // @@ -11,6 +26,12 @@ package org.xerial.snappy; import java.nio.ByteBuffer; +/** + * Interface to access the native code of Snappy + * + * @author leo + * + */ public class SnappyNative { static { @@ -33,7 +54,7 @@ public class SnappyNative public native static int maxCompressedLength(int source_bytes); // This operation takes O(1) time. - public native static int getUncompressedLength(ByteBuffer compressed, int offset, int len) throws SnappyException; + public native static int uncompressedLength(ByteBuffer compressed, int offset, int len) throws SnappyException; public static void throw_error(int errorCode) throws SnappyException { throw new SnappyException(errorCode); diff --git a/src/main/resources/org/xerial/snappy/native/Windows/amd64/snappy.dll b/src/main/resources/org/xerial/snappy/native/Windows/amd64/snappy.dll index e053ecf..efa8b0e 100755 Binary files a/src/main/resources/org/xerial/snappy/native/Windows/amd64/snappy.dll and b/src/main/resources/org/xerial/snappy/native/Windows/amd64/snappy.dll differ diff --git a/src/test/java/org/xerial/snappy/OSInfoTest.java b/src/test/java/org/xerial/snappy/OSInfoTest.java index 963a191..64c9827 100755 --- a/src/test/java/org/xerial/snappy/OSInfoTest.java +++ b/src/test/java/org/xerial/snappy/OSInfoTest.java @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ //-------------------------------------- // snappy-java Project // diff --git a/src/test/java/org/xerial/snappy/SnappyTest.java b/src/test/java/org/xerial/snappy/SnappyTest.java index 1b826c2..ce00f29 100755 --- a/src/test/java/org/xerial/snappy/SnappyTest.java +++ b/src/test/java/org/xerial/snappy/SnappyTest.java @@ -1,3 +1,18 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ //-------------------------------------- // snappy-java Project //