public final class Snappy extends Object
A Snappy abstraction which attempts uses the iq80 implementation and falls back to the xerial Snappy implementation it cannot be loaded. You can change the load order by setting the 'leveldb.snappy' system property. Example:
-Dleveldb.snappy=xerial,iq80
The system property can also be configured with the name of a class which
implements the Snappy.SPI interface.
Modifier and Type | Class and Description |
---|---|
static class |
Snappy.IQ80Snappy |
static interface |
Snappy.SPI |
static class |
Snappy.XerialSnappy |
Modifier and Type | Method and Description |
---|---|
static boolean |
available() |
static int |
compress(byte[] input,
int inputOffset,
int length,
byte[] output,
int outputOffset) |
static byte[] |
compress(String text) |
static int |
maxCompressedLength(int length) |
static void |
uncompress(byte[] input,
int inputOffset,
int length,
byte[] output,
int outputOffset) |
static void |
uncompress(ByteBuffer compressed,
ByteBuffer uncompressed) |
public static boolean available()
public static void uncompress(ByteBuffer compressed, ByteBuffer uncompressed) throws IOException
IOException
public static void uncompress(byte[] input, int inputOffset, int length, byte[] output, int outputOffset) throws IOException
IOException
public static int compress(byte[] input, int inputOffset, int length, byte[] output, int outputOffset) throws IOException
IOException
public static byte[] compress(String text) throws IOException
IOException
public static int maxCompressedLength(int length)
Copyright © 2011–2019. All rights reserved.