public class LZWCodec extends AbstractCodec
CLEAR and
END_OF_INFORMATION codes) are taken in account.
Estimating the worst-case size of compressor output:
N <= 1.41 * nM <= 1.41 * mCLEAR and
END_OF_INFORMATION codes; they occupy less than 3 bytes.
Thus, we can claim than the number of bytes in compressed output never exceeds 1.41*(number of input bytes)+3.
| Constructor and Description |
|---|
LZWCodec() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
compress(byte[] input,
CodecOptions options)
Compresses a block of data.
|
byte[] |
decompress(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> in,
CodecOptions options)
The CodecOptions parameter should have the following fields set:
maxBytes |
compress, decompress, decompress, decompress, decompress, testgetVersion, loggetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetVersion, loggetIdentifiercontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationpublic byte[] compress(byte[] input,
CodecOptions options)
throws FormatException
Codecinput - 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(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> in, CodecOptions options) throws FormatException, IOException
maxBytesin - 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.IOExceptionCodec.decompress(DataHandle, CodecOptions)Copyright © 2011–2026 SCIFIO. All rights reserved.