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 byte[] |
COMPRESSED_SIGNATURE |
static int |
COMPRESSED_SIGNATURE_INT |
static String |
LZW_RTF_PRELOAD |
static byte[] |
UNCOMPRESSED_SIGNATURE |
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(InputStream src,
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 byte[] COMPRESSED_SIGNATURE
public static final byte[] UNCOMPRESSED_SIGNATURE
public static final int COMPRESSED_SIGNATURE_INT
public static final int UNCOMPRESSED_SIGNATURE_INT
public static final String LZW_RTF_PRELOAD
public void decompress(InputStream src, OutputStream res) throws 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
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 © 2020. All rights reserved.