Class PureJavaSnappy

  • All Implemented Interfaces:
    SnappyApi

    public class PureJavaSnappy
    extends java.lang.Object
    implements SnappyApi
    A pure-java Snappy implementation using https://github.com/airlift/aircompressor
    • Constructor Summary

      Constructors 
      Constructor Description
      PureJavaSnappy()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void arrayCopy​(java.lang.Object src, int offset, int byteLength, java.lang.Object dest, int dOffset)  
      boolean isValidCompressedBuffer​(long inputAddr, long offset, long len)  
      boolean isValidCompressedBuffer​(java.lang.Object input, int offset, int len)  
      boolean isValidCompressedBuffer​(java.nio.ByteBuffer compressed, int offset, int len)  
      int maxCompressedLength​(int source_bytes)  
      long rawCompress​(long inputAddr, long inputSize, long destAddr)  
      int rawCompress​(java.lang.Object input, int inputOffset, int inputByteLength, java.lang.Object output, int outputOffset)  
      int rawCompress​(java.nio.ByteBuffer input, int inputOffset, int inputLength, java.nio.ByteBuffer compressed, int outputOffset)  
      long rawUncompress​(long inputAddr, long inputSize, long destAddr)  
      int rawUncompress​(java.lang.Object input, int inputOffset, int inputLength, java.lang.Object output, int outputOffset)  
      int rawUncompress​(java.nio.ByteBuffer compressed, int inputOffset, int inputLength, java.nio.ByteBuffer uncompressed, int outputOffset)  
      long uncompressedLength​(long inputAddr, long len)  
      int uncompressedLength​(java.lang.Object input, int offset, int len)  
      int uncompressedLength​(java.nio.ByteBuffer compressed, int offset, int len)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PureJavaSnappy

        public PureJavaSnappy()
    • Method Detail

      • rawCompress

        public long rawCompress​(long inputAddr,
                                long inputSize,
                                long destAddr)
                         throws java.io.IOException
        Specified by:
        rawCompress in interface SnappyApi
        Throws:
        java.io.IOException
      • rawUncompress

        public long rawUncompress​(long inputAddr,
                                  long inputSize,
                                  long destAddr)
                           throws java.io.IOException
        Specified by:
        rawUncompress in interface SnappyApi
        Throws:
        java.io.IOException
      • rawCompress

        public int rawCompress​(java.nio.ByteBuffer input,
                               int inputOffset,
                               int inputLength,
                               java.nio.ByteBuffer compressed,
                               int outputOffset)
                        throws java.io.IOException
        Specified by:
        rawCompress in interface SnappyApi
        Throws:
        java.io.IOException
      • rawCompress

        public int rawCompress​(java.lang.Object input,
                               int inputOffset,
                               int inputByteLength,
                               java.lang.Object output,
                               int outputOffset)
                        throws java.io.IOException
        Specified by:
        rawCompress in interface SnappyApi
        Throws:
        java.io.IOException
      • rawUncompress

        public int rawUncompress​(java.nio.ByteBuffer compressed,
                                 int inputOffset,
                                 int inputLength,
                                 java.nio.ByteBuffer uncompressed,
                                 int outputOffset)
                          throws java.io.IOException
        Specified by:
        rawUncompress in interface SnappyApi
        Throws:
        java.io.IOException
      • rawUncompress

        public int rawUncompress​(java.lang.Object input,
                                 int inputOffset,
                                 int inputLength,
                                 java.lang.Object output,
                                 int outputOffset)
                          throws java.io.IOException
        Specified by:
        rawUncompress in interface SnappyApi
        Throws:
        java.io.IOException
      • uncompressedLength

        public int uncompressedLength​(java.nio.ByteBuffer compressed,
                                      int offset,
                                      int len)
                               throws java.io.IOException
        Specified by:
        uncompressedLength in interface SnappyApi
        Throws:
        java.io.IOException
      • uncompressedLength

        public int uncompressedLength​(java.lang.Object input,
                                      int offset,
                                      int len)
                               throws java.io.IOException
        Specified by:
        uncompressedLength in interface SnappyApi
        Throws:
        java.io.IOException
      • uncompressedLength

        public long uncompressedLength​(long inputAddr,
                                       long len)
                                throws java.io.IOException
        Specified by:
        uncompressedLength in interface SnappyApi
        Throws:
        java.io.IOException
      • isValidCompressedBuffer

        public boolean isValidCompressedBuffer​(java.nio.ByteBuffer compressed,
                                               int offset,
                                               int len)
                                        throws java.io.IOException
        Specified by:
        isValidCompressedBuffer in interface SnappyApi
        Throws:
        java.io.IOException
      • isValidCompressedBuffer

        public boolean isValidCompressedBuffer​(java.lang.Object input,
                                               int offset,
                                               int len)
                                        throws java.io.IOException
        Specified by:
        isValidCompressedBuffer in interface SnappyApi
        Throws:
        java.io.IOException
      • isValidCompressedBuffer

        public boolean isValidCompressedBuffer​(long inputAddr,
                                               long offset,
                                               long len)
                                        throws java.io.IOException
        Specified by:
        isValidCompressedBuffer in interface SnappyApi
        Throws:
        java.io.IOException
      • arrayCopy

        public void arrayCopy​(java.lang.Object src,
                              int offset,
                              int byteLength,
                              java.lang.Object dest,
                              int dOffset)
                       throws java.io.IOException
        Specified by:
        arrayCopy in interface SnappyApi
        Throws:
        java.io.IOException