public final class CompressedRTF extends LZWDecompresser
HMEFMessage
, the content is often stored in as RTF, but LZW compressed. This class handles decompressing it for you.
(在 HMEFMessage 中,内容通常以 RTF 形式存储,但经过 LZW 压缩。此类为您处理解压缩。)
Modifier and Type | Field and Description |
---|---|
static int |
COMPRESSED_SIGNATURE_INT |
static java.lang.String |
LZW_RTF_PRELOAD |
static int |
UNCOMPRESSED_SIGNATURE_INT |
DICT_MASK, DICT_SIZE
Constructor and Description |
---|
CompressedRTF() |
Modifier and Type | Method and Description |
---|---|
protected int |
adjustDictionaryOffset(int offset)
We use regular dictionary offsets, so no need to change anything
(我们使用常规字典偏移量,因此无需更改任何内容)
|
void |
decompress(java.io.InputStream src, java.io.OutputStream res)
Decompresses the whole of the compressed RTF stream, outputting the resulting RTF bytes.
(解压缩整个压缩的 RTF 流,输出生成的 RTF 字节。)
|
int |
getCompressedSize()
Returns how big the compressed version was.
(返回压缩版本的大小。)
|
int |
getDeCompressedSize()
Returns how big the decompressed version was.
(返回解压后的版本有多大。)
|
protected int |
populateDictionary(byte[] dict)
Populates the dictionary, and returns where in it to begin writing new codes.
(填充字典,并返回其中开始编写新代码的位置。)
|
decompress
public static final int COMPRESSED_SIGNATURE_INT
public static final int UNCOMPRESSED_SIGNATURE_INT
public static final java.lang.String LZW_RTF_PRELOAD
public void decompress(java.io.InputStream src, java.io.OutputStream res) throws java.io.IOException
getDeCompressedSize()
if you need to know how much of the result is real. (Padding may be up to 7 bytes).
(解压缩整个压缩的 RTF 流,输出生成的 RTF 字节。注意 - 将在输入末尾解压缩任何填充,如果存在,如果您需要知道有多少结果是真实的,请使用 getDeCompressedSize()。 (填充最多可达 7 个字节)。)
decompress
in class
LZWDecompresser
java.io.IOException
(java.io.IOException)
public int getCompressedSize()
public int getDeCompressedSize()
protected int adjustDictionaryOffset(int offset)
adjustDictionaryOffset
in class
LZWDecompresser
(类 LZWDecompresser 中的 adjustDictionaryOffset)
protected int populateDictionary(byte[] dict)
LZWDecompresser
populateDictionary
in class
LZWDecompresser
(类 LZWDecompresser 中的 populateDictionary)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.