Difference between revisions of "Org.simantics.fastlz"

From Developer Documents
Jump to navigation Jump to search
m (Created page with ''''org.simantics.fastlz''' is a simple JNI wrapper for the open-source [http://www.fastlz.org/ FastLZ] real-time data compression library. The native library is a pure C implemen...')
 
Line 10: Line 10:
 
All use of the FastLZ java library happens through the [[svn:utils/trunk/org.simantics.fastlz/src/org/simantics/fastlz/FastLZ.java|org.simantics.fastlz.FastLZ]] facade class:
 
All use of the FastLZ java library happens through the [[svn:utils/trunk/org.simantics.fastlz/src/org/simantics/fastlz/FastLZ.java|org.simantics.fastlz.FastLZ]] facade class:
  
     public static native int compress(ByteBuffer input, int inputOffset, int length,
+
     public static native int compressBuffer(ByteBuffer input, int inputOffset, int length,
 
                                       ByteBuffer output, int outputOffset);
 
                                       ByteBuffer output, int outputOffset);
 
   
 
   
     public static native int decompress(ByteBuffer input, int inputOffset, int length,  
+
     public static native int decompressBuffer(ByteBuffer input, int inputOffset, int length,  
 
                                         ByteBuffer output, int outputOffset, int maxout);
 
                                         ByteBuffer output, int outputOffset, int maxout);
 
   
 
   
Line 20: Line 20:
 
     public static OutputStream write(File file) throws FileNotFoundException;
 
     public static OutputStream write(File file) throws FileNotFoundException;
  
All ByteBuffers used in this interface are assumed to be '''direct byte buffers''' (see ByteBuffer.allocateDirect).
+
ByteBuffers used in this interface can be either '''heap''' (ByteBuffer.allocate) or '''direct''' (ByteBuffer.allocateDirect). Use the same buffer type for both arguments for best performance.
  
 
= Download =
 
= Download =

Revision as of 12:01, 29 June 2011

org.simantics.fastlz is a simple JNI wrapper for the open-source FastLZ real-time data compression library. The native library is a pure C implementation. Our version is based on SVN revision 12.

Dependencies

  • None, it is a self-sufficient JAR ready for deployment
  • Data to compress/decompress!

Manual

All use of the FastLZ java library happens through the org.simantics.fastlz.FastLZ facade class:

    public static native int compressBuffer(ByteBuffer input, int inputOffset, int length,
                                      ByteBuffer output, int outputOffset);

    public static native int decompressBuffer(ByteBuffer input, int inputOffset, int length, 
                                        ByteBuffer output, int outputOffset, int maxout);

    public static InputStream read(File file) throws FileNotFoundException;

    public static OutputStream write(File file) throws FileNotFoundException;

ByteBuffers used in this interface can be either heap (ByteBuffer.allocate) or direct (ByteBuffer.allocateDirect). Use the same buffer type for both arguments for best performance.

Download

Version Date Download
1.0.1 24.8.2010 org.simantics.fastlz_1.0.1.jar (OSGi bundle, works as POJO too.)

org.simantics.fastlz.source_1.0.1.jar (OSGi source bundle)

Current Development

Works, no plans for further development.