]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.fastlz/help-isv/org.simantics.fastlz.mediawiki
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.fastlz / help-isv / org.simantics.fastlz.mediawiki
1 '''org.simantics.fastlz''' is a simple JNI wrapper for different open-source real-time data compression libraries. The native library contains pure C implementations. The library also contains pure Java ports of the algorithms which are employed by the front-end if the native library is not available or if arguments are java heap buffers instead of native direct buffers.
2
3 Current codecs:
4 ;[http://www.fastlz.org/ FastLZ]: Our version is based on [http://fastlz.googlecode.com/svn/trunk/ SVN revision 12]. 
5 ;[http://code.google.com/p/lz4/ LZ4]: Our version is based on [http://lz4.googlecode.com/svn/trunk/ SVN revision 68]. 
6
7 = Dependencies =
8
9 * No external Java or native dependencies. It is a self-sufficient JAR ready for deployment as OSGi bundle or POJO. Native DLL's only depend on standard libraries that are always available.
10
11 = Manual =
12
13 Use of both FastLZ and LZ4 codecs happens through the [[https://www.simantics.org/svn/simantics/utils/trunk/org.simantics.fastlz/src/org/simantics/fastlz/CompressionCodec.java|org.simantics.fastlz.CompressionCodec]] interface and the [[https://www.simantics.org/svn/simantics/utils/trunk/org.simantics.fastlz/src/org/simantics/fastlz/Compressions.java|org.simantics.fastlz.Compressions]] facade class:
14 <div style="background-color:#f8f8f8; border: 1px dashed #cccccc; padding: 1ex; margin-left:2em; margin-top: 1em; margin-bottom:1em;">
15 <pre>
16 public final class Compressions {
17
18         public static final String FASTLZ = "FastLZ";
19         public static final String LZ4    = "LZ4";
20
21         public static CompressionCodec get(String codec);
22         public static OutputStream write(String codec, File file) throws FileNotFoundException;
23         public static InputStream read(String codec, File file) throws FileNotFoundException;
24
25 }
26
27 public interface CompressionCodec {
28
29         int compressBound(int inputSize);
30         int compressBuffer(ByteBuffer input, int inputOffset, int length,
31                         ByteBuffer output, int outputOffset);
32
33         int decompressBuffer(ByteBuffer input, int inputOffset, int length,
34                         ByteBuffer output, int outputOffset, int maxout);
35
36         InputStream read(File file) throws FileNotFoundException;
37         OutputStream write(File file) throws FileNotFoundException;
38
39 }
40 </pre>
41 </div>
42
43 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. Output buffers must be writable or IllegalArgumentException is thrown.
44
45 See the [[https://www.simantics.org/svn/simantics/utils/trunk/org.simantics.fastlz/src/org/simantics/fastlz/|actual code]] for proper Javadoc.
46
47 = Download =
48
49 {| style="background-color: #e9e9e9; border: 1px solid #aaaaaa; width: 75%;"
50 | '''Version'''
51 | '''Date'''
52 | '''Download'''
53 |- style="background-color: #f9f9f9; " |
54 | 1.2.0
55 | 12.7.2012
56 | [https://www.simantics.org/svn/simantics/utils/trunk/org.simantics.fastlz/ SVN]
57 |}
58
59 = Future Development =
60
61 * Add pure Java implementation of LZ4 as a fallback
62 * Rename plug-in to org.simantics.compression