diff --git a/Milestone.md b/Milestone.md index 9a1781a..afc50e1 100644 --- a/Milestone.md +++ b/Milestone.md @@ -2,7 +2,11 @@ * `SnappyIndexer` for parallel compression/decompression * CUI commands (snap/unsnap) -## snappy-java-1.1.0-M1 (27 March, 2013) +## snappy-java-1.1.0-M2 (28 March 2013) + * Fix linux amd64 build + * Fixes #26 + +## snappy-java-1.1.0-M1 (27 March 2013) * Upgrade to snappy-1.1.0 * Add zero-copy compression (rawCompress, rawUncompress) that can be used with LArray * Drop 32-bit Mac support diff --git a/pom.xml b/pom.xml index 054125b..d48d5a8 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.xerial.snappy snappy-java - 1.1.0-M1 + 1.1.0-M2 Snappy for Java snappy-java: A fast compression/decompression library bundle diff --git a/src/main/java/org/xerial/snappy/Snappy.java b/src/main/java/org/xerial/snappy/Snappy.java index 2247498..dbc29c8 100755 --- a/src/main/java/org/xerial/snappy/Snappy.java +++ b/src/main/java/org/xerial/snappy/Snappy.java @@ -151,7 +151,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(char[] input) { + public static byte[] compress(char[] input) throws IOException { return rawCompress(input, input.length * 2); // char uses 2 bytes } @@ -161,7 +161,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(double[] input) { + public static byte[] compress(double[] input) throws IOException { return rawCompress(input, input.length * 8); // double uses 8 bytes } @@ -171,7 +171,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(float[] input) { + public static byte[] compress(float[] input) throws IOException { return rawCompress(input, input.length * 4); // float uses 4 bytes } @@ -181,7 +181,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(int[] input) { + public static byte[] compress(int[] input) throws IOException { return rawCompress(input, input.length * 4); // int uses 4 bytes } @@ -191,7 +191,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(long[] input) { + public static byte[] compress(long[] input) throws IOException { return rawCompress(input, input.length * 8); // long uses 8 bytes } @@ -201,7 +201,7 @@ public class Snappy * @param input * @return the compressed data */ - public static byte[] compress(short[] input) { + public static byte[] compress(short[] input) throws IOException { return rawCompress(input, input.length * 2); // short uses 2 bytes } @@ -354,7 +354,7 @@ public class Snappy * the input byte size * @return compressed data */ - public static byte[] rawCompress(Object data, int byteSize) { + public static byte[] rawCompress(Object data, int byteSize) throws IOException { byte[] buf = new byte[Snappy.maxCompressedLength(byteSize)]; int compressedByteSize = ((SnappyNativeAPI) impl).rawCompress(data, 0, byteSize, buf, 0); byte[] result = new byte[compressedByteSize]; diff --git a/src/main/java/org/xerial/snappy/SnappyNative.h b/src/main/java/org/xerial/snappy/SnappyNative.h index 37452d9..477d30a 100755 --- a/src/main/java/org/xerial/snappy/SnappyNative.h +++ b/src/main/java/org/xerial/snappy/SnappyNative.h @@ -15,6 +15,22 @@ extern "C" { JNIEXPORT jstring JNICALL Java_org_xerial_snappy_SnappyNative_nativeLibraryVersion (JNIEnv *, jobject); +/* + * Class: org_xerial_snappy_SnappyNative + * Method: rawCompress + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_xerial_snappy_SnappyNative_rawCompress__JJJ + (JNIEnv *, jobject, jlong, jlong, jlong); + +/* + * Class: org_xerial_snappy_SnappyNative + * Method: rawUncompress + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_xerial_snappy_SnappyNative_rawUncompress__JJJ + (JNIEnv *, jobject, jlong, jlong, jlong); + /* * Class: org_xerial_snappy_SnappyNative * Method: rawCompress @@ -71,6 +87,14 @@ JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_uncompressedLength__L JNIEXPORT jint JNICALL Java_org_xerial_snappy_SnappyNative_uncompressedLength__Ljava_lang_Object_2II (JNIEnv *, jobject, jobject, jint, jint); +/* + * Class: org_xerial_snappy_SnappyNative + * Method: uncompressedLength + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_xerial_snappy_SnappyNative_uncompressedLength__JJ + (JNIEnv *, jobject, jlong, jlong); + /* * Class: org_xerial_snappy_SnappyNative * Method: isValidCompressedBuffer diff --git a/src/main/java/org/xerial/snappy/SnappyNative.java b/src/main/java/org/xerial/snappy/SnappyNative.java index 3c9acf5..fdcb617 100755 --- a/src/main/java/org/xerial/snappy/SnappyNative.java +++ b/src/main/java/org/xerial/snappy/SnappyNative.java @@ -54,7 +54,7 @@ public class SnappyNative implements SnappyNativeAPI public native int rawCompress(ByteBuffer input, int inputOffset, int inputLength, ByteBuffer compressed, int outputOffset) throws IOException; - public native int rawCompress(Object input, int inputOffset, int inputByteLength, Object output, int outputOffset); + public native int rawCompress(Object input, int inputOffset, int inputByteLength, Object output, int outputOffset) throws IOException; public native int rawUncompress(ByteBuffer compressed, int inputOffset, int inputLength, ByteBuffer uncompressed, int outputOffset) throws IOException; diff --git a/src/main/java/org/xerial/snappy/SnappyNativeAPI.java b/src/main/java/org/xerial/snappy/SnappyNativeAPI.java index 902e22e..b6c92d0 100755 --- a/src/main/java/org/xerial/snappy/SnappyNativeAPI.java +++ b/src/main/java/org/xerial/snappy/SnappyNativeAPI.java @@ -51,7 +51,7 @@ public interface SnappyNativeAPI public int rawCompress(ByteBuffer input, int inputOffset, int inputLength, ByteBuffer compressed, int outputOffset) throws IOException; - public int rawCompress(Object input, int inputOffset, int inputByteLength, Object output, int outputOffset); + public int rawCompress(Object input, int inputOffset, int inputByteLength, Object output, int outputOffset) throws IOException; public int rawUncompress(ByteBuffer compressed, int inputOffset, int inputLength, ByteBuffer uncompressed, int outputOffset) throws IOException; diff --git a/src/main/resources/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so b/src/main/resources/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so index 83f5e4f..62f164c 100755 Binary files a/src/main/resources/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so and b/src/main/resources/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so differ