Class LZ4FastDecompressor

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int decompress​(byte[] src, byte[] dest)
      Convenience method, equivalent to calling decompress(src, dest, dest.length).
      int decompress​(byte[] src, byte[] dest, int destLen)
      Convenience method, equivalent to calling decompress(src, 0, dest, 0, destLen).
      byte[] decompress​(byte[] src, int destLen)
      Convenience method, equivalent to calling decompress(src, 0, destLen).
      abstract int decompress​(byte[] src, int srcOff, byte[] dest, int destOff, int destLen)
      Decompresses src[srcOff:] into dest[destOff:destOff+destLen] and returns the number of bytes read from src.
      byte[] decompress​(byte[] src, int srcOff, int destLen)
      Convenience method which returns src[srcOff:?] decompressed.
      abstract int decompress​(java.nio.ByteBuffer src, int srcOff, java.nio.ByteBuffer dest, int destOff, int destLen)
      Decompresses src[srcOff:] into dest[destOff:destOff+destLen] and returns the number of bytes read from src.
      void decompress​(java.nio.ByteBuffer src, java.nio.ByteBuffer dest)
      Decompresses src into dest.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • LZ4FastDecompressor

        public LZ4FastDecompressor()
    • Method Detail

      • decompress

        public abstract int decompress​(byte[] src,
                                       int srcOff,
                                       byte[] dest,
                                       int destOff,
                                       int destLen)
        Decompresses src[srcOff:] into dest[destOff:destOff+destLen] and returns the number of bytes read from src. destLen must be exactly the size of the decompressed data.
        Specified by:
        decompress in interface LZ4Decompressor
        Parameters:
        src - the compressed data
        srcOff - the start offset in src
        dest - the destination buffer to store the decompressed data
        destOff - the start offset in dest
        destLen - the exact size of the original input
        Returns:
        the number of bytes read to restore the original input
      • decompress

        public abstract int decompress​(java.nio.ByteBuffer src,
                                       int srcOff,
                                       java.nio.ByteBuffer dest,
                                       int destOff,
                                       int destLen)
        Decompresses src[srcOff:] into dest[destOff:destOff+destLen] and returns the number of bytes read from src. destLen must be exactly the size of the decompressed data. The positions and limits of the ByteBuffers remain unchanged.
        Parameters:
        src - the compressed data
        srcOff - the start offset in src
        dest - the destination buffer to store the decompressed data
        destOff - the start offset in dest
        destLen - the exact size of the original input
        Returns:
        the number of bytes read to restore the original input
      • decompress

        public final int decompress​(byte[] src,
                                    byte[] dest,
                                    int destLen)
        Convenience method, equivalent to calling decompress(src, 0, dest, 0, destLen).
        Parameters:
        src - the compressed data
        dest - the destination buffer to store the decompressed data
        destLen - the exact size of the original input
        Returns:
        the number of bytes read to restore the original input
      • decompress

        public final int decompress​(byte[] src,
                                    byte[] dest)
        Convenience method, equivalent to calling decompress(src, dest, dest.length).
        Parameters:
        src - the compressed data
        dest - the destination buffer to store the decompressed data
        Returns:
        the number of bytes read to restore the original input
      • decompress

        public final byte[] decompress​(byte[] src,
                                       int srcOff,
                                       int destLen)
        Convenience method which returns src[srcOff:?] decompressed.

        Warning: this method has an important overhead due to the fact that it needs to allocate a buffer to decompress into.

        Here is how this method is implemented:

         final byte[] decompressed = new byte[destLen];
         decompress(src, srcOff, decompressed, 0, destLen);
         return decompressed;
         
        Parameters:
        src - the compressed data
        srcOff - the start offset in src
        destLen - the exact size of the original input
        Returns:
        the decompressed data
      • decompress

        public final byte[] decompress​(byte[] src,
                                       int destLen)
        Convenience method, equivalent to calling decompress(src, 0, destLen).
        Parameters:
        src - the compressed data
        destLen - the exact size of the original input
        Returns:
        the decompressed data
      • decompress

        public final void decompress​(java.nio.ByteBuffer src,
                                     java.nio.ByteBuffer dest)
        Decompresses src into dest. dest's Buffer.remaining() must be exactly the size of the decompressed data. This method moves the positions of the buffers.
        Parameters:
        src - the compressed data
        dest - the destination buffer to store the decompressed data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object