Package ome.codecs
Class HuffmanCodec
java.lang.Object
ome.codecs.BaseCodec
ome.codecs.HuffmanCodec
- All Implemented Interfaces:
Codec
This class implements Huffman decoding.
- Author:
- Melissa Linkert melissa at glencoesoftware.com
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] data, CodecOptions options) Compresses a block of data.byte[]decompress(loci.common.RandomAccessInputStream in, CodecOptions options) The CodecOptions parameter must be an instance ofHuffmanCodecOptions, and should have the following fields set:tablebitsPerSamplemaxBytesintgetSample(loci.common.RandomAccessInputStream bb, CodecOptions options) intgetSample(BitBuffer bb, CodecOptions options) Deprecated.Methods inherited from class ome.codecs.BaseCodec
compress, compress, decompress, decompress, decompress, decompress, test
-
Constructor Details
-
HuffmanCodec
public HuffmanCodec()
-
-
Method Details
-
compress
Description copied from interface:CodecCompresses 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 The CodecOptions parameter must be an instance ofHuffmanCodecOptions, and should have the following fields set:tablebitsPerSamplemaxBytes- Specified by:
decompressin interfaceCodec- Specified by:
decompressin classBaseCodec- 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- See Also:
-
getSample
Deprecated.- Throws:
CodecException
-
getSample
public int getSample(loci.common.RandomAccessInputStream bb, CodecOptions options) throws CodecException - Throws:
CodecException
-