Snappy.compress method declaration includes "throws IOException". Implementation just calls rawCompress() that does not throw IOException so this throws is not needed.
It makes sense that when operating on in memory byte array there is no place to throw IOException.
It looks like I forgot to add throws IOException statement in rawCompress.
throws IOException statement
In the native code (SnappyNative.cpp), there is a possibility that it throws IOException when an invalid object is passed to this API.
It would be a corner case, but rawCompress uses GetPrimitiveArrayCritical in JNI, and it would throw when arrays must be copied to somewhere in JVM heap but sufficient amount of memory is not available.
Oracle JDK and OpenJDK never create copies of arrays in GetPrimitiveArrayCritical, so this error never happens. The other JVM implementation might have different behavior.
Fixes #26. Add throws IOException to rawCompress
#26. Add throws IOException to compress methods