Class AirBlockCompressor

    • Constructor Detail

      • AirBlockCompressor

        public AirBlockCompressor​(io.airlift.compress.Compressor internalCompressor)
    • Method Detail

      • compress

        public int compress​(ByteBuffer src,
                            int srcOff,
                            int srcLen,
                            ByteBuffer dst,
                            int dstOff)
                     throws BufferCompressionException
        Description copied from interface: BlockCompressor
        Compress source data read from (Buffer.position() + srcOff), and write the compressed data to dst.
        Specified by:
        compress in interface BlockCompressor
        Parameters:
        src - Uncompressed data to read from
        srcOff - The start offset of uncompressed data
        srcLen - The length of data which want to be compressed
        dst - The target to write compressed data
        dstOff - The start offset to write the compressed data
        Returns:
        Length of compressed data
        Throws:
        BufferCompressionException - if exception thrown when compressing
      • compress

        public int compress​(byte[] src,
                            int srcOff,
                            int srcLen,
                            byte[] dst,
                            int dstOff)
                     throws BufferCompressionException
        Description copied from interface: BlockCompressor
        Compress data read from src, and write the compressed data to dst.
        Specified by:
        compress in interface BlockCompressor
        Parameters:
        src - Uncompressed data to read from
        srcOff - The start offset of uncompressed data
        srcLen - The length of data which want to be compressed
        dst - The target to write compressed data
        dstOff - The start offset to write the compressed data
        Returns:
        Length of compressed data
        Throws:
        BufferCompressionException - if exception thrown when compressing