Merge branch 'release/1.1.0-M2'

This commit is contained in:
Taro L. Saito 2013-03-28 15:07:30 +09:00
commit 8d097faaf5
7 changed files with 39 additions and 11 deletions

View File

@ -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 <https://github.com/xerial/larray>
* Drop 32-bit Mac support

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.0-M1</version>
<version>1.1.0-M2</version>
<name>Snappy for Java</name>
<description>snappy-java: A fast compression/decompression library</description>
<packaging>bundle</packaging>

View File

@ -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];

View File

@ -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

View File

@ -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;

View File

@ -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;