public class LZWCodec extends BaseCodec
CLEAR
and END_OF_INFORMATION
codes)
are taken in account.
Estimating the worst-case size of compressor output:
Modifier and Type | Field and Description |
---|---|
private static int |
CLEAR_CODE |
private static int[] |
COMPR_MASKS
Masks for writing bits in compressor.
|
private static int[] |
DECOMPR_MASKS
Masks for reading bits in decompressor.
|
private static int |
EOI_CODE |
private static int |
FIRST_CODE |
private static int |
HASH_SIZE
Size of hash table.
|
private static int |
HASH_STEP
Rehashing step.
|
Constructor and Description |
---|
LZWCodec() |
Modifier and Type | Method and Description |
---|---|
byte[] |
compress(byte[] input,
CodecOptions options)
Compresses a block of data.
|
byte[] |
decompress(loci.common.RandomAccessInputStream in,
CodecOptions options)
The CodecOptions parameter should have the following fields set:
maxBytes |
compress, decompress, decompress, decompress, decompress, test
private static final int HASH_SIZE
private static final int HASH_STEP
private static final int CLEAR_CODE
private static final int EOI_CODE
private static final int FIRST_CODE
private static final int[] COMPR_MASKS
private static final int[] DECOMPR_MASKS
public byte[] compress(byte[] input, CodecOptions options) throws FormatException
Codec
input
- The data to be compressed.options
- Options to be used during compression, if appropriate.FormatException
- If input is not a compressed data block of the
appropriate type.public byte[] decompress(loci.common.RandomAccessInputStream in, CodecOptions options) throws FormatException, IOException
maxBytes
decompress
in interface Codec
decompress
in class BaseCodec
in
- The stream from which to read compressed data.options
- Options to be used during decompression.FormatException
- If data is not valid compressed data for this
decompressor.IOException
Codec.decompress(RandomAccessInputStream, CodecOptions)
Copyright © 2017 Open Microscopy Environment