]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.lz4/src/net/jpountz/xxhash/XXHashJNI.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.lz4 / src / net / jpountz / xxhash / XXHashJNI.java
1 package net.jpountz.xxhash;
2
3 /*
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 import java.nio.ByteBuffer;
18
19 import net.jpountz.util.Native;
20
21 enum XXHashJNI {
22   ;
23
24   static {
25     Native.load();
26     init();
27   }
28
29   private static native void init();
30   static native int XXH32(byte[] input, int offset, int len, int seed);
31   static native int XXH32BB(ByteBuffer input, int offset, int len, int seed);
32   static native long XXH32_init(int seed);
33   static native void XXH32_update(long state, byte[] input, int offset, int len);
34   static native int XXH32_digest(long state);
35   static native void XXH32_free(long state);
36
37   static native long XXH64(byte[] input, int offset, int len, long seed);
38   static native long XXH64BB(ByteBuffer input, int offset, int len, long seed);
39   static native long XXH64_init(long seed);
40   static native void XXH64_update(long state, byte[] input, int offset, int len);
41   static native long XXH64_digest(long state);
42   static native void XXH64_free(long state);
43 }