![]() 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 has been open sourced under the New BSD License.Snappy-java is a Java port of the snappy, a fast C++ compresser/decompresser developed by Google. The tool comes as a C++ library that is linked into the product that is supposed to use it, but there are several other bindings for it: Haskell, Java, Perl, Python, and Ruby. Snappy can be used to benchmark itself against a number of other compression libraries - zlib, LZO, LZF, FastLZ and QuickLZ –, if they are installed on the same machine. Google touts Snappy as robust being “designed not to crash in the face of corrupted or malicious input”, and stable after being used to compress petabytes of data in Google’s production environment. The high compression speed is achieved by losing on the compression ratio, the resulting output being 20-100% larger than that of other libraries, Snappy having a compression ratio of “1.5-1.7x for plain text, about 2-4x for HTML, and of course 1.0x for JPEGs, PNGs and other already-compressed data”. Snappy has been optimized for 64-bit x86 processors, on a single core Intel Core i7 processor achieving a compression rate of at least 250MB/s and a decompression one of 500MB/s. Google says the library and its algorithm has been tuned for speed, and not for compression output size nor compatibility with other similar tools. Snappy, previously known as Zippy, is a compression library used by Google in production internally by many projects including BigTable, MapReduce and RPC. Google has open sourced Snappy, a compressing/decompressing library that processes data streams at minimum 250MB/s-500MB/s on a single core Intel Core i7 processor.
0 Comments
Leave a Reply. |