public abstract class LZWDecompresser
extends java.lang.Object
Two good resources on LZW are: http://en.wikipedia.org/wiki/LZW http://marknelson.us/1989/10/01/lzw-data-compression/
(此类为不同文件格式的各种 LZW 实现提供通用功能。它目前被 HDGF 和 HMEF 使用。关于 LZW 的两个很好的资源是:http://en.wikipedia.org/wiki/LZW http://marknelson.us/1989/10/01/lzw-data-compression/)Modifier and Type | Field and Description |
---|---|
static int |
DICT_MASK
the mask for calculating / wrapping dictionary offsets
(用于计算/包装字典偏移量的掩码)
|
static int |
DICT_SIZE
the size of our dictionary
(我们字典的大小)
|
Modifier | Constructor and Description |
---|---|
protected |
LZWDecompresser(boolean maskMeansCompressed, int codeLengthIncrease, boolean positionIsBigEndian) |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
adjustDictionaryOffset(int offset)
Adjusts the position offset if needed when looking something up in the dictionary.
(在字典中查找内容时根据需要调整位置偏移量。)
|
byte[] |
decompress(java.io.InputStream src)
Decompresses the given input stream, returning the array of bytes of the decompressed input.
(解压缩给定的输入流,返回解压缩输入的字节数组。)
|
void |
decompress(java.io.InputStream src, java.io.OutputStream res)
Perform a streaming decompression of the input.
(对输入执行流式解压缩。)
|
protected abstract int |
populateDictionary(byte[] dict)
Populates the dictionary, and returns where in it to begin writing new codes.
(填充字典,并返回其中开始编写新代码的位置。)
|
public static final int DICT_SIZE
public static final int DICT_MASK
protected LZWDecompresser(boolean maskMeansCompressed, int codeLengthIncrease, boolean positionIsBigEndian)
protected abstract int populateDictionary(byte[] dict)
protected abstract int adjustDictionaryOffset(int offset)
public byte[] decompress(java.io.InputStream src) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public void decompress(java.io.InputStream src, java.io.OutputStream res) throws java.io.IOException
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.