Public Member Functions | |
Inflater () | |
Creates a new inflater or RFC1951 decompressor RFC1950/Zlib headers and footers will be expected in the input data. | |
Inflater (bool noHeader) | |
Creates a new inflater. | |
void | Reset () |
Resets the inflater so that a new stream can be decompressed. All pending input and output will be discarded. | |
void | SetDictionary (byte[] buffer) |
Sets the preset dictionary. This should only be called, if needsDictionary() returns true and it should set the same dictionary, that was used for deflating. The getAdler() function returns the checksum of the dictionary needed. | |
void | SetDictionary (byte[] buffer, int offset, int len) |
Sets the preset dictionary. This should only be called, if needsDictionary() returns true and it should set the same dictionary, that was used for deflating. The getAdler() function returns the checksum of the dictionary needed. | |
void | SetInput (byte[] buf) |
Sets the input. This should only be called, if needsInput() returns true. | |
void | SetInput (byte[] buffer, int offset, int length) |
Sets the input. This should only be called, if needsInput() returns true. | |
int | Inflate (byte[] buf) |
Inflates the compressed stream to the output buffer. If this returns 0, you should check, whether needsDictionary(), needsInput() or finished() returns true, to determine why no further output is produced. | |
int | Inflate (byte[] buf, int offset, int len) |
Inflates the compressed stream to the output buffer. If this returns 0, you should check, whether needsDictionary(), needsInput() or finished() returns true, to determine why no further output is produced. | |
Properties | |
bool | IsNeedingInput |
Returns true, if the input buffer is empty. You should then call setInput(). NOTE: This method also returns true when the stream is finished. | |
bool | IsNeedingDictionary |
Returns true, if a preset dictionary is needed to inflate the input. | |
bool | IsFinished |
Returns true, if the inflater has finished. This means, that no input is needed and no output can be produced. | |
int | Adler |
Gets the adler checksum. This is either the checksum of all uncompressed bytes returned by inflate(), or if needsDictionary() returns true (and thus no output was yet produced) this is the adler checksum of the expected dictionary. | |
int | TotalOut |
Gets the total number of output bytes returned by inflate(). | |
int | TotalIn |
Gets the total number of processed compressed input bytes. | |
int | UnseenInput |
-jr test hak trying to figure out a bug /summary> | |
int | PlainTotalIn |
-jr test hak trying to figure out a bug /summary> | |
int | RemainingInput |
Gets the number of unprocessed input bytes. Useful, if the end of the stream is reached and you want to further process the bytes after the deflate stream. | |
Private Member Functions | |
bool | DecodeHeader () |
Decodes a zlib/RFC1950 header. | |
bool | DecodeDict () |
Decodes the dictionary checksum after the deflate header. | |
bool | DecodeHuffman () |
Decodes the huffman encoded symbols in the input stream. | |
bool | DecodeChksum () |
Decodes the adler checksum after the deflate stream. | |
bool | Decode () |
Decodes the deflated stream. | |
Private Attributes | |
const int | DECODE_HEADER = 0 |
These are the possible states for an inflater. | |
const int | DECODE_DICT = 1 |
const int | DECODE_BLOCKS = 2 |
const int | DECODE_STORED_LEN1 = 3 |
const int | DECODE_STORED_LEN2 = 4 |
const int | DECODE_STORED = 5 |
const int | DECODE_DYN_HEADER = 6 |
const int | DECODE_HUFFMAN = 7 |
const int | DECODE_HUFFMAN_LENBITS = 8 |
const int | DECODE_HUFFMAN_DIST = 9 |
const int | DECODE_HUFFMAN_DISTBITS = 10 |
const int | DECODE_CHKSUM = 11 |
const int | FINISHED = 12 |
int | mode |
This variable contains the current state. | |
int | readAdler |
The adler checksum of the dictionary or of the decompressed stream, as it is written in the header resp. footer of the compressed stream. Only valid if mode is DECODE_DICT or DECODE_CHKSUM. | |
int | neededBits |
The number of bits needed to complete the current state. This is valid, if mode is DECODE_DICT, DECODE_CHKSUM, DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. | |
int | repLength |
int | repDist |
int | uncomprLen |
bool | isLastBlock |
True, if the last block flag was set in the last block of the inflated stream. This means that the stream ends after the current block. | |
int | totalOut |
The total number of inflated bytes. | |
int | totalIn |
The total number of bytes set with setInput(). This is not the value returned by the TotalIn property, since this also includes the unprocessed input. | |
bool | noHeader |
This variable stores the noHeader flag that was given to the constructor. True means, that the inflated stream doesn't contain a Zlib header or footer. | |
StreamManipulator | input |
OutputWindow | outputWindow |
InflaterDynHeader | dynHeader |
InflaterHuffmanTree | litlenTree |
InflaterHuffmanTree | distTree |
Adler32 | adler |
Static Private Attributes | |
static int[] | CPLENS |
Copy lengths for literal codes 257..285. | |
static int[] | CPLEXT |
Extra bits for literal codes 257..285. | |
static int[] | CPDIST |
Copy offsets for distance codes 0..29. | |
static int[] | CPDEXT |
Extra bits for distance codes. |
By default Zlib (rfc1950) headers and footers are expected in the input. You can use constructor
public Inflater(bool noHeader)</code> passing true if there is no Zlib header information The usage is as following. First you have to set some input with <code>setInput()</code>, then inflate() it. If inflate doesn't inflate any bytes there may be three reasons: <ul> <li>needsInput() returns true because the input buffer is empty. You have to provide more input with <code>setInput()</code>. NOTE: needsInput() also returns true when, the stream is finished. </li> <li>needsDictionary() returns true, you have to provide a preset dictionary with <code>setDictionary()</code>.</li> <li>finished() returns true, the inflater has finished.</li> </ul> Once the first output byte is produced, a dictionary will not be needed at a later stage. author of the original java version : John Leuner, Jochen Hoenicke
Definition at line 73 of file Inflater.cs.
|
Creates a new inflater or RFC1951 decompressor RFC1950/Zlib headers and footers will be expected in the input data.
Definition at line 185 of file Inflater.cs. |
|
Creates a new inflater.
For compatibility with Sun JDK you should provide one byte of input more than needed in this case. Definition at line 201 of file Inflater.cs. |
|
Decodes the deflated stream.
Definition at line 422 of file Inflater.cs. |
|
Decodes the adler checksum after the deflate stream.
Definition at line 395 of file Inflater.cs. |
|
Decodes the dictionary checksum after the deflate header.
Definition at line 276 of file Inflater.cs. |
|
Decodes a zlib/RFC1950 header.
Definition at line 236 of file Inflater.cs. |
|
Decodes the huffman encoded symbols in the input stream.
Definition at line 300 of file Inflater.cs. |
|
Inflates the compressed stream to the output buffer. If this returns 0, you should check, whether needsDictionary(), needsInput() or finished() returns true, to determine why no further output is produced.
Definition at line 670 of file Inflater.cs. |
|
Inflates the compressed stream to the output buffer. If this returns 0, you should check, whether needsDictionary(), needsInput() or finished() returns true, to determine why no further output is produced.
Definition at line 638 of file Inflater.cs. |
|
Resets the inflater so that a new stream can be decompressed. All pending input and output will be discarded.
Definition at line 214 of file Inflater.cs. |
|
Sets the preset dictionary. This should only be called, if needsDictionary() returns true and it should set the same dictionary, that was used for deflating. The getAdler() function returns the checksum of the dictionary needed.
Definition at line 567 of file Inflater.cs. |
|
Sets the preset dictionary. This should only be called, if needsDictionary() returns true and it should set the same dictionary, that was used for deflating. The getAdler() function returns the checksum of the dictionary needed.
Definition at line 541 of file Inflater.cs. |
|
Sets the input. This should only be called, if needsInput() returns true.
Definition at line 613 of file Inflater.cs. |
|
Sets the input. This should only be called, if needsInput() returns true.
Definition at line 589 of file Inflater.cs. Referenced by ICSharpCode::SharpZipLib::Zip::Compression::Streams::InflaterInputBuffer::SetInflaterInput(). |
|
Definition at line 179 of file Inflater.cs. |
|
Initial value: { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }
Definition at line 103 of file Inflater.cs. |
|
Initial value: { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }
Definition at line 94 of file Inflater.cs. |
|
Initial value: { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }
Definition at line 78 of file Inflater.cs. |
|
Initial value: { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }
Definition at line 86 of file Inflater.cs. |
|
Definition at line 114 of file Inflater.cs. |
|
Definition at line 123 of file Inflater.cs. |
|
Definition at line 113 of file Inflater.cs. |
|
Definition at line 118 of file Inflater.cs. |
|
These are the possible states for an inflater.
Definition at line 112 of file Inflater.cs. |
|
Definition at line 119 of file Inflater.cs. |
|
Definition at line 121 of file Inflater.cs. |
|
Definition at line 122 of file Inflater.cs. |
|
Definition at line 120 of file Inflater.cs. |
|
Definition at line 117 of file Inflater.cs. |
|
Definition at line 115 of file Inflater.cs. |
|
Definition at line 116 of file Inflater.cs. |
|
Definition at line 178 of file Inflater.cs. |
|
Definition at line 177 of file Inflater.cs. |
|
Definition at line 124 of file Inflater.cs. |
|
Definition at line 175 of file Inflater.cs. |
|
True, if the last block flag was set in the last block of the inflated stream. This means that the stream ends after the current block.
Definition at line 154 of file Inflater.cs. |
|
Definition at line 178 of file Inflater.cs. |
|
This variable contains the current state.
Definition at line 129 of file Inflater.cs. |
|
The number of bits needed to complete the current state. This is valid, if mode is DECODE_DICT, DECODE_CHKSUM, DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS.
Definition at line 144 of file Inflater.cs. |
|
This variable stores the noHeader flag that was given to the constructor. True means, that the inflated stream doesn't contain a Zlib header or footer.
Definition at line 173 of file Inflater.cs. |
|
Definition at line 176 of file Inflater.cs. |
|
The adler checksum of the dictionary or of the decompressed stream, as it is written in the header resp. footer of the compressed stream. Only valid if mode is DECODE_DICT or DECODE_CHKSUM.
Definition at line 137 of file Inflater.cs. |
|
Definition at line 146 of file Inflater.cs. |
|
Definition at line 145 of file Inflater.cs. |
|
The total number of bytes set with setInput(). This is not the value returned by the TotalIn property, since this also includes the unprocessed input.
Definition at line 166 of file Inflater.cs. |
|
The total number of inflated bytes.
Definition at line 159 of file Inflater.cs. |
|
Definition at line 147 of file Inflater.cs. |
|
Gets the adler checksum. This is either the checksum of all uncompressed bytes returned by inflate(), or if needsDictionary() returns true (and thus no output was yet produced) this is the adler checksum of the expected dictionary.
Definition at line 753 of file Inflater.cs. |
|
Returns true, if the inflater has finished. This means, that no input is needed and no output can be produced.
Definition at line 738 of file Inflater.cs. |
|
Returns true, if a preset dictionary is needed to inflate the input.
Definition at line 728 of file Inflater.cs. |
|
Returns true, if the input buffer is empty. You should then call setInput(). NOTE: This method also returns true when the stream is finished.
Definition at line 719 of file Inflater.cs. |
|
-jr test hak trying to figure out a bug /summary>
Definition at line 796 of file Inflater.cs. |
|
Gets the number of unprocessed input bytes. Useful, if the end of the stream is reached and you want to further process the bytes after the deflate stream.
Definition at line 811 of file Inflater.cs. |
|
Gets the total number of processed compressed input bytes.
Definition at line 777 of file Inflater.cs. |
|
Gets the total number of output bytes returned by inflate().
Definition at line 765 of file Inflater.cs. |
|
-jr test hak trying to figure out a bug /summary>
Definition at line 787 of file Inflater.cs. |