Package ome.codecs

Class LZ4Codec

  • All Implemented Interfaces:
    Codec

    public class LZ4Codec
    extends BaseCodec
    This class implements LZ4 decompression.
    Author:
    Rolf Harkes r.harkes at nki.nl
    • Constructor Detail

      • LZ4Codec

        public LZ4Codec()
    • Method Detail

      • compress

        public byte[] compress​(byte[] data,
                               CodecOptions options)
                        throws CodecException
        Description copied from interface: Codec
        Compresses a block of data.
        Parameters:
        data - The data to be compressed.
        options - Options to be used during compression, if appropriate.
        Returns:
        The compressed data.
        Throws:
        CodecException - If input is not a compressed data block of the appropriate type.
      • decompress

        public byte[] decompress​(loci.common.RandomAccessInputStream in,
                                 CodecOptions options)
                          throws CodecException,
                                 IOException
        Description copied from interface: Codec
        Decompresses data from the given RandomAccessInputStream.
        Specified by:
        decompress in interface Codec
        Specified by:
        decompress in class BaseCodec
        Parameters:
        in - The stream from which to read compressed data.
        options - Options to be used during decompression.
        Returns:
        The decompressed data.
        Throws:
        CodecException - If data is not valid compressed data for this decompressor.
        IOException
      • decompress

        public byte[] decompress​(byte[] data)
                          throws CodecException
        Description copied from interface: Codec
        Decompresses a block of data.
        Specified by:
        decompress in interface Codec
        Overrides:
        decompress in class BaseCodec
        Parameters:
        data - the data to be decompressed.
        Returns:
        The decompressed data.
        Throws:
        CodecException - If data is not valid compressed data for this decompressor.
      • decompress

        public byte[] decompress​(byte[] data,
                                 CodecOptions options)
                          throws CodecException
        Description copied from interface: Codec
        Decompresses a block of data.
        Specified by:
        decompress in interface Codec
        Overrides:
        decompress in class BaseCodec
        Parameters:
        data - the data to be decompressed
        options - Options to be used during decompression.
        Returns:
        the decompressed data.
        Throws:
        CodecException - If data is not valid.
      • decompress

        public byte[] decompress​(byte[] data,
                                 int inputOffset,
                                 int length,
                                 int outputLength)
                          throws CodecException
        Decompresses a block of data of specified length from an initial offset.
        Parameters:
        data - The data to be decompressed.
        inputOffset - The position of the input data at which to begin decompression.
        length - The length of input data to be decompressed.
        Returns:
        The decompressed data.
        Throws:
        CodecException - If data is not valid.