Class IUnCompressor.LZ4UnCompressor

    • Constructor Detail

      • LZ4UnCompressor

        public LZ4UnCompressor()
    • Method Detail

      • getUncompressedLength

        public int getUncompressedLength​(java.nio.ByteBuffer buffer)
        Description copied from interface: IUnCompressor
        get the uncompressed length.
        Specified by:
        getUncompressedLength in interface IUnCompressor
        Parameters:
        buffer - MUST be DirectByteBuffer
      • uncompress

        public byte[] uncompress​(byte[] bytes)
                          throws java.io.IOException
        We don't recommend using this method because we have to allocate MAX_COMPRESS_RATIO * compressedSize to ensure uncompress safety, you can use other method if you know the uncompressed size
        Specified by:
        uncompress in interface IUnCompressor
        Parameters:
        bytes - to be uncompressed bytes
        Returns:
        bytes after uncompressed
        Throws:
        java.io.IOException
      • uncompress

        public int uncompress​(byte[] byteArray,
                              int offset,
                              int length,
                              byte[] output,
                              int outOffset)
                       throws java.io.IOException
        Description copied from interface: IUnCompressor
        uncompress the byte array.
        Specified by:
        uncompress in interface IUnCompressor
        Parameters:
        byteArray - -to be uncompressed bytes
        offset - -offset
        length - -length
        output - -output byte
        outOffset - -
        Returns:
        the valid length of the output array
        Throws:
        java.io.IOException
      • uncompress

        public int uncompress​(java.nio.ByteBuffer compressed,
                              java.nio.ByteBuffer uncompressed)
                       throws java.io.IOException
        Description copied from interface: IUnCompressor
        if the data is large, using this function is better.
        Specified by:
        uncompress in interface IUnCompressor
        Parameters:
        compressed - MUST be DirectByteBuffer
        uncompressed - MUST be DirectByteBuffer
        Throws:
        java.io.IOException