Class Snappy

java.lang.Object
org.iq80.leveldb.util.Snappy

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.

  • Field Details

  • Constructor Details

    • Snappy

      private Snappy()
  • Method Details

    • available

      public static boolean available()
    • uncompress

      public static void uncompress(ByteBuffer compressed, ByteBuffer uncompressed) throws IOException
      Throws:
      IOException
    • uncompress

      public static void uncompress(byte[] input, int inputOffset, int length, byte[] output, int outputOffset) throws IOException
      Throws:
      IOException
    • compress

      public static int compress(byte[] input, int inputOffset, int length, byte[] output, int outputOffset) throws IOException
      Throws:
      IOException
    • compress

      public static byte[] compress(String text) throws IOException
      Throws:
      IOException
    • maxCompressedLength

      public static int maxCompressedLength(int length)