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.Modifier and Type | Field and Description |
---|---|
static int |
COMPRESSED_SIGNATURE_INT |
static java.lang.String |
LZW_RTF_PRELOAD |
static int |
UNCOMPRESSED_SIGNATURE_INT |
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.
|
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, fromByte, fromInt
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).decompress
in class LZWDecompresser
java.io.IOException
public int getCompressedSize()
public int getDeCompressedSize()
protected int adjustDictionaryOffset(int offset)
adjustDictionaryOffset
in class LZWDecompresser
protected int populateDictionary(byte[] dict)
LZWDecompresser
populateDictionary
in class LZWDecompresser
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.