![]() ![]() It later addedĪ "framing" format to define a file format, but by this point major software wasĪlready using an industry standard instead - represented in this library by the The original Snappy format definition did not define a file format. SnappyFramedOutputStream/ SnappyFramedInputStream can be used for the framing format. Stream-based compressor/decompressor SnappyOutputStream/ SnappyInputStream are also available for reading/writing large data sets. ), Snappy.rawUncompress(.), etc.), which minimize memory copies, can be used. In addition, high-level methods ( press(String), press(float. String result = new String(uncompressed, "UTF-8") + "Snappy, a fast compresser/decompresser." īyte compressed = press(input.getBytes("UTF-8")) īyte uncompressed = Snappy.uncompress(compressed) Then use press(byte) and Snappy.uncompress(byte): String input = "Hello snappy-java! Snappy-java is a JNI-based wrapper of " Using with sbt libraryDependencies += "" % "snappy-java" % "(version)"įirst, import in your Java code: import Add the following dependency to your pom.xml: ![]() Snappy-java is available from Maven's central repository. Snapshot version (the latest beta version):.The current stable version is available from here: The decompression speed is twice as fast as the others:.The benchmark result indicates snappy-java is the fastest compressor/decompressor in Java:.Thanks Tatu Saloranta for providing the benchmark suite. Here are some benchmark results, comparing So the compression ratio of snappy-java is modest and about the same as LZF (ranging 20%-100% according to the dataset). Snappy's main target is very high-speed compression/decompression with reasonable compression size. Free for both commercial and non-commercial use. Framing-format support (Since 1.1.0 version).Then call compression/decompression methods in. Add the snappy-java-(version).jar file to your classpath. snappy-java loads one of these libraries according to your machine environment (It looks system properties, os.name and os.arch). Portable across various operating systems Snappy-java contains native libraries built for Window/Mac/Linux, etc.To improve the compression ratios of these arrays, you can use a fast data-rearrangement implementation ( BitShuffle) before compression.Compression/decompression of Java primitive arrays ( float, double, int, short, long, etc.).Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g.JNI-based implementation to achieve comparable performance to the native C++ version.SnappyOutputStream uses only 32KB+ in default. Fast compression/decompression around 200~400MB/sec.Snappy-java is a Java port of the snappy, a fast C++ compresser/decompresser developed by Google. ![]()
0 Comments
Leave a Reply. |