diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a427da3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+*~
+*.class
+*.log
+
+# IntelliJ
+.idea
+.idea_modules
+
+# sbt specific
+bin/.lib
+dist/*
+target/
+lib_managed/
+src_managed/
+project/boot/
+project/plugins/project/
+
+# Scala-IDE specific
+.scala_dependencies
+
diff --git a/Makefile b/Makefile
index 05add4d..a9ca277 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,11 @@ test: $(NATIVE_DLL)
$(MVN) test
win32:
- $(MAKE) native CXX=mingw32-g++ OS_NAME=Windows OS_ARCH=x86
+ $(MAKE) native CROSS_PREFIX=i686-w64-mingw32- OS_NAME=Windows OS_ARCH=x86
+
+# for cross-compilation on Ubuntu, install the g++-mingw-w64-x86-64 package
+win64:
+ $(MAKE) native CROSS_PREFIX=x86_64-w64-mingw32- OS_NAME=Windows OS_ARCH=amd64
mac32:
$(MAKE) native OS_NAME=Mac OS_ARCH=i386
@@ -90,6 +94,14 @@ mac32:
linux32:
$(MAKE) native OS_NAME=Linux OS_ARCH=i386
+# for cross-compilation on Ubuntu, install the g++-arm-linux-gnueabi package
+linux-arm:
+ $(MAKE) native CROSS_PREFIX=arm-linux-gnueabi- OS_NAME=Linux OS_ARCH=arm
+
+# for cross-compilation on Ubuntu, install the g++-arm-linux-gnueabihf package
+linux-armhf:
+ $(MAKE) native CROSS_PREFIX=arm-linux-gnueabihf- OS_NAME=Linux OS_ARCH=armhf
+
clean-native-linux32:
$(MAKE) clean-native OS_NAME=Linux OS_ARCH=i386
diff --git a/Makefile.common b/Makefile.common
index f565104..d704b4e 100755
--- a/Makefile.common
+++ b/Makefile.common
@@ -105,15 +105,15 @@ Mac-x86_64_LINKFLAGS := -dynamiclib -static-libgcc
Mac-x86_64_LIBNAME := libsnappyjava.jnilib
Mac-x86_64_SNAPPY_FLAGS :=
-Windows-x86_CXX := mingw32-g++
-Windows-x86_STRIP := strip
+Windows-x86_CXX := $(CROSS_PREFIX)g++
+Windows-x86_STRIP := $(CROSS_PREFIX)strip
Windows-x86_CXXFLAGS := -Ilib/inc_win -O2
Windows-x86_LINKFLAGS := -Wl,--kill-at -shared -static
Windows-x86_LIBNAME := snappyjava.dll
Windows-x86_SNAPPY_FLAGS :=
-Windows-amd64_CXX := x86_64-w64-mingw32-g++
-Windows-amd64_STRIP := x86_64-w64-mingw32-strip
+Windows-amd64_CXX := $(CROSS_PREFIX)g++
+Windows-amd64_STRIP := $(CROSS_PREFIX)strip
Windows-amd64_CXXFLAGS := -Ilib/inc_win -O2
Windows-amd64_LINKFLAGS := -Wl,--kill-at -shared -static
Windows-amd64_LIBNAME := snappyjava.dll
diff --git a/Milestone.md b/Milestone.md
new file mode 100644
index 0000000..e8e08b5
--- /dev/null
+++ b/Milestone.md
@@ -0,0 +1,59 @@
+## Features under consideration
+ * `SnappyIndexer` for parallel compression/decompression
+ * CUI commands (snap/unsnap)
+
+## snappy-java-1.0.4.1 (5 September 2011)
+ * Fixes issue 33: Fixes a problem when reading incomplete input stream
+
+## snappy-java-1.0.4 (September 22nd, 2011)
+ * Upgrade to snappy-1.0.4
+ * Enhanced the Javadoc
+
+## snappy-java-1.0.3.3 (September 10th, 2011)
+ * Add support for Oracle JRockit JVM. (issue 28)
+
+## snappy-java-1.0.3.2 (August 23rd, 2011)
+ * Upgrade from the previous release is optional
+ * Add system properites to switch sytem installed native library or bundled
+ library (issue 20, issue 26)
+ * source code tar ball (issue 25)
+ * primitive array read/write support (issue 24)
+
+## snappy-java-1.0.3.1 (August 2nd, 2011)
+ * Maintenance release (no significant change)
+ * Refactoring code
+ * Rebuild win32 binary
+
+## snappy-java-1.0.3 (July 11st, 2011)
+ * Deprected SnappyException. Instead snappy-java uses IOException to issue
+ errors. This change is necessary to support JNI code injection to a parent
+ class loader.
+
+## snappy-java-1.0.3-rc4 (June 27th, 2011)
+ * JNI interface injection so that multiple applications can share the native
+ code. Issue 21
+
+## snappy-java-1.0.3-rc3 (June 21st, 2011)
+ * Fixes issue 18, issue 19
+ * Reduces memory footprint (contribution from Arec Wysoker)
+
+## snappy-java-1.0.3-rc2 (June 7th, 2011)
+ * Fixes issue 17
+
+## snappy-java-1.0.3-rc1 (June 4th, 2011)
+ * Upgrade to snappy-1.0.3 done.
+ * libstdc++ embedding (only for Linux version) done.
+ * Minor bug fixes
+
+## snappy-java-1.0.1-rc4 (April 11th, 2011)
+ * Primitive array support (e.g. `int[]`, `float[]`, etc.) issue 10
+ * String compression/decompression
+
+## snappy-java-1.0.1-rc3 (April 4th, 2011)
+ * Running tests under win32/mac32, etc.
+
+## snappy-java-1.0.1-rc2 (April 2nd, 2011)
+ * Adding `SnappyOutputStream` `SnappyInputStream` issue 3
+
+
+ * March 29th. Started snappy-java project
\ No newline at end of file
diff --git a/README b/README
deleted file mode 100755
index d060d44..0000000
--- a/README
+++ /dev/null
@@ -1,102 +0,0 @@
-This document is a copy of http://code.google.com/p/snappy-java/
-
----------------------------------------
-The snappy-java is a Java port of the snappy http://code.google.com/p/snappy/, a fast compresser/decompresser written in C++ developed by Google.
-
-== Features ==
- * [http://www.apache.org/licenses/LICENSE-2.0 Apache Licence Version 2.0]. Free for both commercial and non-commercial use.
- * Fast compression/decompression tailored to 64-bit CPU architecture.
- * JNI-based implementation to achieve comparable performance to the native C++ version.
- * Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g. Tomcat, etc.).
- * Portable across various operating systems; Snappy-java contains native libraries built for Window/Mac/Linux (32/64-bit). At runtime, snappy-java loads one of these libraries according to your machine environment (It looks system properties, `os.name` and `os.arch`).
- * Simple usage. Add the snappy-java-(version).jar file to your classpath. Then call compression/decompression methods in org.xerial.snappy.Snappy.
-
-== Performance ==
- * Snappy's main target is very high-speed compression/decompression with reasonable compression size. So the compression ratio of snappy-java is modest and about the same as `LZF` (ranging 20%-100% according to the dataset).
-
- * Here are some [https://github.com/ning/jvm-compressor-benchmark/wiki benchmark results], comparing snappy-java and the other compressors `LZO-java`/`LZF`/`QuickLZ`/`Gzip`/`Bzip2`. Thanks [http://twitter.com/#!/cowtowncoder Tatu Saloranta @cowtowncoder] for providing the benchmark suite.
- * The benchmark result indicates snappy-java is the fastest compreesor/decompressor in Java:
- * http://ning.github.com/jvm-compressor-benchmark/results/canterbury-roundtrip-2011-07-28/index.html
- * The decompression speed is twice as fast as the others:
- * http://ning.github.com/jvm-compressor-benchmark/results/canterbury-uncompress-2011-07-28/index.html
-
-
-
-== Download ==
-The current stable version 1.0.3.1 is available from here:
- * Release version: http://maven.xerial.org/repository/artifact/org/xerial/snappy/snappy-java
- * [Milestone] release plans
- * Snapshot version (the latest beta version): http://maven.xerial.org/repository/snapshot/org/xerial/snappy/snappy-java/
-
-If you are a Maven user, see [#Using_with_Maven]
-
-== Usage ==
-First, import `org.xerial.snapy.Snappy` in your Java code:
-{{{
-import org.xerial.snappy.Snappy;
-}}}
-
-Then use `Snappy.compress(byte[])` and `Snappy.uncompress(byte[])`:
-{{{
-String input = "Hello snappy-java! Snappy-java is a JNI-based wrapper of "
-+ "Snappy, a fast compresser/decompresser.";
-byte[] compressed = Snappy.compress(input.getBytes("UTF-8"));
-byte[] uncompressed = Snappy.uncompress(compressed);
-
-String result = new String(uncompressed, "UTF-8");
-System.out.println(result);
-}}}
-
-In addition, high-level methods (`Snappy.compress(String)`, `Snappy.compress(float[] ..)` etc. ) and low-level ones (e.g. `Snappy.rawCompress(.. )`, `Snappy.rawUncompress(..)`, etc.), which minimize memory copies, can be used. See also
-[http://code.google.com/p/snappy-java/source/browse/src/main/java/org/xerial/snappy/Snappy.java Snappy.java]
-
-===Stream-based API===
-Stream-based compressor/decompressor `SnappyOutputStream`/`SnappyInputStream` are also available for reading/writing large data sets.
-
-===Setting classpath==
-If you have snappy-java-(VERSION).jar in the current directory, use `-classpath` option as follows:
-{{{
-$ javac -classpath ".;snappy-java-(VERSION).jar" Sample.java # in Windows
-or
-$ javac -classpath ".:snappy-java-(VERSION).jar" Sample.java # in Mac or Linux
-}}}
-
-===Using with Maven===
- * Snappy-java is available from Maven's central repository: http://repo1.maven.org/maven2/org/xerial/snappy/snappy-java
-
-Add the following dependency to your pom.xml:
-{{{
-
- org.xerial.snappy
- snappy-java
- (version)
- jar
- compile
-
-}}}
-
-==Public discussion group==
-Post bug reports or feature request to the Issue Tracker: http://code.google.com/p/snappy-java/issues/list
-
-Public discussion forum is here: [http://groups.google.com/group/xerial?hl=en Xerial Public Discussion Group].
-
-
-== Building from the source code ==
-See the [http://code.google.com/p/snappy-java/source/browse/INSTALL installation instruction]. Building from the source code is an option when your OS platform and CPU architecture is not supported. To build snappy-java, you need Mercurial(hg), JDK (1.6 or higher), Maven (3.x or higher is required), g++ compiler (mingw in Windows) etc.
-
-{{{
-$ hg clone https://snappy-java.googlecode.com/hg/ snappy-java
-$ cd snappy-java
-$ make
-}}}
-
-A file `target/snappy-java-$(version).jar` is the product additionally containing the native library built for your platform.
-
-==Miscellaneous Notes==
-===Using snappy-java with Tomcat 6 (or higher) Web Server===
-
-Simply put the snappy-java's jar to WEB-INF/lib folder of your web application. Usual JNI-library specific problem no longer exists since snappy-java version 1.0.3 or higher can be loaded by multiple class loaders in the same JVM by using native code injection to the parent class loader (Issue 21).
-
-
-----
-Snappy-java is developed by [http://www.xerial.org/leo Taro L. Saito]. Twitter [http://twitter.com/#!/taroleo @taroleo]
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..c69a55f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,119 @@
+The snappy-java is a Java port of the snappy
+, a fast C++ compresser/decompresser developed by Google.
+
+## Features
+ * [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). Free for both commercial and non-commercial use.
+ * Fast compression/decompression tailored to 64-bit CPU architecture.
+ * JNI-based implementation to achieve comparable performance to the native C++ version.
+ * Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g. Tomcat, etc.).
+ * Portable across various operating systems; Snappy-java contains native libraries built for Window/Mac/Linux (32/64-bit). At runtime, snappy-java loads one of these libraries according to your machine environment (It looks system properties, `os.name` and `os.arch`).
+ * Simple usage. Add the snappy-java-(version).jar file to your classpath. Then call compression/decompression methods in org.xerial.snappy.Snappy.
+
+## Performance
+ * Snappy's main target is very high-speed compression/decompression with reasonable compression size. So the compression ratio of snappy-java is modest and about the same as `LZF` (ranging 20%-100% according to the dataset).
+
+ * Here are some [benchmark results](https://github.com/ning/jvm-compressor-benchmark/wiki), comparing
+ snappy-java and the other compressors
+ `LZO-java`/`LZF`/`QuickLZ`/`Gzip`/`Bzip2`. Thanks [Tatu Saloranta @cotowncoder](http://twitter.com/#!/cowtowncoder) for providing the benchmark suite.
+ * The benchmark result indicates snappy-java is the fastest compreesor/decompressor in Java:
+ *
+ * The decompression speed is twice as fast as the others:
+ *
+
+
+## Download
+The current stable version is available from here:
+ * Release version: http://maven.xerial.org/repository/artifact/org/xerial/snappy/snappy-java
+ * [release plans](./snappy-java/Milestone.md)
+ * Snapshot version (the latest beta version): https://oss.sonatype.org/content/repositories/snapshots/org/xerial/snappy/snappy-java/
+If you are a Maven user, see [#Using_with_Maven]
+
+## Usage
+First, import `org.xerial.snapy.Snappy` in your Java code:
+
+ import org.xerial.snappy.Snappy;
+
+
+Then use `Snappy.compress(byte[])` and `Snappy.uncompress(byte[])`:
+
+ String input = "Hello snappy-java! Snappy-java is a JNI-based wrapper of "
+ + "Snappy, a fast compresser/decompresser.";
+ byte[] compressed = Snappy.compress(input.getBytes("UTF-8"));
+ byte[] uncompressed = Snappy.uncompress(compressed);
+
+ String result = new String(uncompressed, "UTF-8");
+ System.out.println(result);
+
+
+In addition, high-level methods (`Snappy.compress(String)`, `Snappy.compress(float[] ..)` etc. ) and low-level ones (e.g. `Snappy.rawCompress(.. )`, `Snappy.rawUncompress(..)`, etc.), which minimize memory copies, can be used. See also
+[Snappy.java](https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/Snappy.java)
+
+### Stream-based API
+Stream-based compressor/decompressor `SnappyOutputStream`/`SnappyInputStream` are also available for reading/writing large data sets.
+
+### Setting classpath
+If you have snappy-java-(VERSION).jar in the current directory, use `-classpath` option as follows:
+
+ $ javac -classpath ".;snappy-java-(VERSION).jar" Sample.java # in Windows
+ or
+ $ javac -classpath ".:snappy-java-(VERSION).jar" Sample.java # in Mac or Linux
+
+
+### Using with Maven
+ * Snappy-java is available from Maven's central repository:
+
+Add the following dependency to your pom.xml:
+
+
+ org.xerial.snappy
+ snappy-java
+ (version)
+ jar
+ compile
+
+
+
+## Public discussion group
+Post bug reports or feature request to the Issue Tracker:
+
+Public discussion forum is here:
+
+
+## Building from the source code
+See the [installation instruction](https://github.com/xerial/snappy-java/blob/develop/INSTALL). Building from the source code is an option when your OS platform and CPU architecture is not supported. To build snappy-java, you need Git, JDK (1.6 or higher), Maven (3.x or higher is required), g++ compiler (mingw in Windows) etc.
+
+ $ git clone https://github.com/xerial/snappy-java.git
+ $ cd snappy-java
+ $ make
+
+
+A file `target/snappy-java-$(version).jar` is the product additionally containing the native library built for your platform.
+
+## Cross-compiling for other platforms
+The Makefile contains rules for cross-compiling the native library for other platforms so that the snappy-java JAR can support multiple platforms. For example, to build the native libraries for x86 Linux, x86 and x86-64 Windows, and soft- and hard-float ARM:
+
+ $ make linux32 win32 win64 linux-arm linux-armhf
+
+If you append `snappy` to the line above, it will also build the native library for the current platform and then build the snappy-java JAR (containing all native libraries built so far).
+
+Of course, you must first have the necessary cross-compilers and development libraries installed for each target CPU and OS. For example, on Ubuntu 12.04 for x86-64, install the following packages for each target:
+
+ * linux32: `sudo apt-get install g++-multilib libc6-dev-i386 lib32stdc++6`
+ * win32: `sudo apt-get install g++-mingw-w64-i686`
+ * win64: `sudo apt-get install g++-mingw-w64-x86-64`
+ * arm: `sudo apt-get install g++-arm-linux-gnueabi`
+ * armhf: `sudo apt-get install g++-arm-linux-gnueabihf`
+
+Unfortunately, cross-compiling for Mac OS X is not currently possible; you must compile within OS X.
+
+If you are using Mac and openjdk7 (or higher), use the following option:
+
+ $ make native LIBNAME=libsnappyjava.dylib
+
+## Miscellaneous Notes
+### Using snappy-java with Tomcat 6 (or higher) Web Server
+
+Simply put the snappy-java's jar to WEB-INF/lib folder of your web application. Usual JNI-library specific problem no longer exists since snappy-java version 1.0.3 or higher can be loaded by multiple class loaders in the same JVM by using native code injection to the parent class loader (Issue 21).
+
+----
+Snappy-java is developed by [Taro L. Saito](http://www.xerial.org/leo). Twitter [@taroleo](http://twitter.com/#!/taroleo)
diff --git a/pom.xml b/pom.xml
index 215c299..c019165 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1,298 +1,283 @@
-
-
- 4.0.0
- org.xerial.snappy
- snappy-java
- 1.0.5-SNAPSHOT
- Snappy for Java
- snappy-java: A fast compression/decompression library
- bundle
-
-
- UTF-8
-
-
-
-
- The Apache Software License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
-
-
- leo
- Taro L. Saito
- leo@xerial.org
- Xerial Project
-
- Architect
- Project Manager
- Chief Developer
-
- +9
-
-
-
-
- xerial.org
- http://www.xerial.org/
-
-
-
-
-
- src/main/java
-
- org/xerial/snappy/VERSION
-
-
-
- src/main/resources
-
- org/xerial/snappy/*.bytecode
- org/xerial/snappy/native/**
-
-
-
- ${basedir}
- META-INF/maven/${project.groupId}/${project.artifactId}
-
- LICENSE*
-
-
-
-
-
- src/test/java
-
- **/*.java
-
-
-
- src/test/resources
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 2.5
-
- UTF-8
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.0.2
-
- 1.5
- 1.5
-
-
-
-
- maven-release-plugin
- 2.1
-
-
- deploy
- scm:hg:https://snappy-java.googlecode.com/hg/
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.8
-
- UTF-8
- en_US
- public
- stylesheet.css
-
-
-
- attach-javadocs
- verify
-
- jar
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.1.2
-
- true
-
-
-
- attach-sources
- verify
-
- jar
-
-
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 2.3.4
- true
-
-
- ${project.groupId}.${project.artifactId}
- ${pproject.name}
- ${project.version}
- org.xerial.snappy.SnappyBundleActivator
- org.xerial.snappy
- org.osgi.framework;version="[1.5,2)"
-
-
-
-
-
- maven-assembly-plugin
- 2.2.1
-
-
- src/assembly/project.xml
-
- false
- false
-
-
-
- make-assembly
- package
-
- single
-
-
-
-
-
-
-
-
- org.apache.maven.wagon
- wagon-ssh-external
- 1.0-beta-7
-
-
-
-
-
-
- http://code.google.com/p/snappy-java/
-
- Google Code
- http://code.google.com/p/snappy-java/issues/list
-
- 2011
-
- scm:hg:https://snappy-java.googlecode.com/hg/
- scm:hg:default
- scm:hg:https://snappy-java.googlecode.com/hg/
-
-
-
-
-
- xerial.scp
- scpexe://www.xerial.org/home/web/maven.xerial.org/repository/site
-
-
- xerial.scp
- Xerial Maven Repository
- scpexe://www.xerial.org/home/web/maven.xerial.org/repository/artifact
-
-
- xerial.scp
- Xerial Maven Snapshot Repository
- scpexe://www.xerial.org/home/web/maven.xerial.org/repository/snapshot
- false
-
-
-
-
-
-
- sourceforge
-
-
- xerial.sourceforge
- Xerial maven repository at sourceforge.jp
- scpexe://shell.sourceforge.jp/home/groups/x/xe/xerial/htdocs/maven/release
-
-
-
-
-
-
- xerial.local
-
-
- xerial.local
- Xerial Maven Repository
- file:///home/web/maven.xerial.org/repository/artifact
-
-
- xerial.local
- Xerial Maven Snapshot Repository
- file:///home/web/maven.xerial.org/repository/snapshot
- false
-
-
- xerial.local
- file:///home/web/maven.xerial.org/repository/site
-
-
-
-
-
-
-
-
-
- junit
- junit
- 4.8.2
- jar
- test
-
-
-
- org.codehaus.plexus
- plexus-classworlds
- 2.4
- jar
- test
-
-
- org.osgi
- core
- 4.3.0
- jar
- provided
-
-
- org.xerial
- xerial-core
- 1.0.21
- jar
- test
-
-
-
+
+
+ 4.0.0
+ org.xerial.snappy
+ snappy-java
+ 1.0.5-M1
+ Snappy for Java
+ snappy-java: A fast compression/decompression library
+ bundle
+
+
+ org.sonatype.oss
+ oss-parent
+ 7
+
+
+
+ UTF-8
+
+
+
+
+ The Apache Software License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+
+
+ leo
+ Taro L. Saito
+ leo@xerial.org
+ Xerial Project
+
+ Architect
+ Project Manager
+ Chief Developer
+
+ +9
+
+
+
+
+ xerial.org
+ http://www.xerial.org/
+
+
+
+
+
+ src/main/java
+
+ org/xerial/snappy/VERSION
+
+
+
+ src/main/resources
+
+ org/xerial/snappy/*.bytecode
+ org/xerial/snappy/native/**
+
+
+
+ ${basedir}
+ META-INF/maven/${project.groupId}/${project.artifactId}
+
+ LICENSE*
+
+
+
+
+
+ src/test/java
+
+ **/*.java
+
+
+
+ src/test/resources
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.5
+
+ UTF-8
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.0.2
+
+ 1.5
+ 1.5
+
+
+
+
+ maven-release-plugin
+ 2.1
+
+
+ deploy
+ false
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.4
+
+ true
+
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.8
+
+ UTF-8
+ en_US
+ public
+ stylesheet.css
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.1.2
+
+ true
+
+
+
+ attach-sources
+ verify
+
+ jar-no-fork
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ 2.3.4
+ true
+
+
+ ${project.groupId}.${project.artifactId}
+ ${pproject.name}
+ ${project.version}
+ org.xerial.snappy.SnappyBundleActivator
+ org.xerial.snappy
+ org.osgi.framework;version="[1.5,2)"
+
+
+
+
+
+ maven-assembly-plugin
+ 2.2.1
+
+
+ src/assembly/project.xml
+
+ false
+ false
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
+
+
+
+
+ org.apache.maven.wagon
+ wagon-ssh-external
+ 1.0-beta-7
+
+
+
+
+
+
+ http://github.com/xerial/snappy-java/
+
+ GitHub
+ http://github.com/xerial/snappy-java/issues/list
+
+ 2011
+
+ scm:git@github.com:xerial/snappy-java.git
+ scm:git:git@github.com:xerial/snappy-java.git
+ git@github.com:xerial/snappy-java.git
+
+
+
+
+
+ xerial.local
+
+
+ xerial.local
+ Xerial Maven Repository
+ file:///home/web/maven.xerial.org/repository/artifact
+
+
+ xerial.local
+ Xerial Maven Snapshot Repository
+ file:///home/web/maven.xerial.org/repository/snapshot
+ false
+
+
+ xerial.local
+ file:///home/web/maven.xerial.org/repository/site
+
+
+
+
+
+
+
+
+
+ junit
+ junit
+ 4.8.2
+ jar
+ test
+
+
+
+ org.codehaus.plexus
+ plexus-classworlds
+ 2.4
+ jar
+ test
+
+
+ org.osgi
+ core
+ 4.3.0
+ jar
+ provided
+
+
+ org.xerial
+ xerial-core
+ 1.0.21
+ jar
+ test
+
+
+
diff --git a/src/main/java/org/xerial/snappy/Snappy.java b/src/main/java/org/xerial/snappy/Snappy.java
index dac227f..e44ded2 100755
--- a/src/main/java/org/xerial/snappy/Snappy.java
+++ b/src/main/java/org/xerial/snappy/Snappy.java
@@ -26,6 +26,7 @@ package org.xerial.snappy;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.lang.ExceptionInInitializerError;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
@@ -33,6 +34,9 @@ import java.util.Properties;
/**
* Snappy API for data compression/decompression
+ *
+ * Note: if the native libraries cannot be loaded, then an ExceptionInInitializerError
+ * will be thrown at first use of this class.
*
* @author leo
*
@@ -44,7 +48,7 @@ public class Snappy
impl = SnappyLoader.load();
}
catch (Exception e) {
- e.printStackTrace();
+ throw new ExceptionInInitializerError(e);
}
}
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 30c2db2..8a7cb95 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
diff --git a/src/main/resources/org/xerial/snappy/native/Linux/armhf/libsnappyjava.so b/src/main/resources/org/xerial/snappy/native/Linux/armhf/libsnappyjava.so
new file mode 100755
index 0000000..e30dbbd
Binary files /dev/null and b/src/main/resources/org/xerial/snappy/native/Linux/armhf/libsnappyjava.so differ
diff --git a/src/main/resources/org/xerial/snappy/native/Linux/i386/libsnappyjava.so b/src/main/resources/org/xerial/snappy/native/Linux/i386/libsnappyjava.so
index b30209d..548fc6e 100755
Binary files a/src/main/resources/org/xerial/snappy/native/Linux/i386/libsnappyjava.so and b/src/main/resources/org/xerial/snappy/native/Linux/i386/libsnappyjava.so differ
diff --git a/src/main/resources/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib b/src/main/resources/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib
new file mode 100755
index 0000000..6a177ac
Binary files /dev/null and b/src/main/resources/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib differ