Public Member Functions | |
Deflater () | |
Creates a new deflater with default compression level. | |
Deflater (int lvl) | |
Creates a new deflater with given compression level. | |
Deflater (int level, bool noZlibHeaderOrFooter) | |
Creates a new deflater with given compression level. | |
void | Reset () |
Resets the deflater. The deflater acts afterwards as if it was just created with the same compression level and strategy as it had before. | |
void | Flush () |
Flushes the current input block. Further calls to deflate() will produce enough output to inflate everything in the current input block. This is not part of Sun's JDK so I have made it package private. It is used by DeflaterOutputStream to implement flush(). | |
void | Finish () |
Finishes the deflater with the current input block. It is an error to give more input after this method was called. This method must be called to force all bytes to be flushed. | |
void | SetInput (byte[] input) |
Sets the data which should be compressed next. This should be only called when needsInput indicates that more input is needed. If you call setInput when needsInput() returns false, the previous input that is still pending will be thrown away. The given byte array should not be changed, before needsInput() returns true again. This call is equivalent to setInput(input, 0, input.length)</code>. | |
void | SetInput (byte[] input, int off, int len) |
Sets the data which should be compressed next. This should be only called when needsInput indicates that more input is needed. The given byte array should not be changed, before needsInput() returns true again. | |
void | SetLevel (int lvl) |
Sets the compression level. There is no guarantee of the exact position of the change, but if you call this when needsInput is true the change of compression level will occur somewhere near before the end of the so far given input. | |
int | GetLevel () |
Get current compression level. | |
void | SetStrategy (DeflateStrategy strategy) |
Sets the compression strategy. Strategy is one of DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact position where the strategy is changed, the same as for setLevel() applies. | |
int | Deflate (byte[] output) |
Deflates the current input block with to the given array. | |
int | Deflate (byte[] output, int offset, int length) |
Deflates the current input block to the given array. | |
void | SetDictionary (byte[] dict) |
Sets the dictionary which should be used in the deflate process. This call is equivalent to setDictionary(dict, 0, dict.Length)</code>. | |
void | SetDictionary (byte[] dict, int offset, int length) |
Sets the dictionary which should be used in the deflate process. The dictionary is a byte array containing strings that are likely to occur in the data which should be compressed. The dictionary is not stored in the compressed output, only a checksum. To decompress the output you need to supply the same dictionary again. | |
Static Public Attributes | |
static int | BEST_COMPRESSION = 9 |
The best and slowest compression level. This tries to find very long and distant string repetitions. | |
static int | BEST_SPEED = 1 |
The worst but fastest compression level. | |
static int | DEFAULT_COMPRESSION = -1 |
The default compression level. | |
static int | NO_COMPRESSION = 0 |
This level won't compress at all but output uncompressed blocks. | |
static int | DEFLATED = 8 |
The compression method. This is the only method supported so far. There is no need to use this constant at all. | |
Properties | |
int | Adler |
Gets the current adler checksum of the data that was processed so far. | |
int | TotalIn |
Gets the number of input bytes processed so far. | |
long | TotalOut |
Gets the number of output bytes so far. | |
bool | IsFinished |
Returns true if the stream was finished and no more output bytes are available. | |
bool | IsNeedingInput |
Returns true, if the input buffer is empty. You should then call setInput(). NOTE: This method can also return true when the stream was finished. | |
Private Attributes | |
int | level |
Compression level. | |
bool | noZlibHeaderOrFooter |
If true no Zlib/RFC1950 headers or footers are generated. | |
int | state |
The current state. | |
long | totalOut |
The total bytes of output written. | |
DeflaterPending | pending |
The pending output. | |
DeflaterEngine | engine |
The deflater engine. | |
Static Private Attributes | |
static int | IS_SETDICT = 0x01 |
static int | IS_FLUSHING = 0x04 |
static int | IS_FINISHING = 0x08 |
static int | INIT_STATE = 0x00 |
static int | SETDICT_STATE = 0x01 |
static int | BUSY_STATE = 0x10 |
static int | FLUSHING_STATE = 0x14 |
static int | FINISHING_STATE = 0x1c |
static int | FINISHED_STATE = 0x1e |
static int | CLOSED_STATE = 0x7f |
This class is not thread safe. This is inherent in the API, due to the split of deflate and setInput.
author of the original java version : Jochen Hoenicke
Definition at line 55 of file Deflater.cs.
|
Creates a new deflater with default compression level.
Definition at line 166 of file Deflater.cs. |
|
Creates a new deflater with given compression level.
Definition at line 179 of file Deflater.cs. |
|
Creates a new deflater with given compression level.
Definition at line 197 of file Deflater.cs. |
|
Deflates the current input block to the given array.
Definition at line 426 of file Deflater.cs. |
|
Deflates the current input block with to the given array.
Definition at line 399 of file Deflater.cs. |
|
Finishes the deflater with the current input block. It is an error to give more input after this method was called. This method must be called to force all bytes to be flushed.
Definition at line 271 of file Deflater.cs. |
|
Flushes the current input block. Further calls to deflate() will produce enough output to inflate everything in the current input block. This is not part of Sun's JDK so I have made it package private. It is used by DeflaterOutputStream to implement flush().
Definition at line 261 of file Deflater.cs. Referenced by ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Flush(). |
|
Get current compression level.
Definition at line 371 of file Deflater.cs. |
|
Resets the deflater. The deflater acts afterwards as if it was just created with the same compression level and strategy as it had before.
Definition at line 219 of file Deflater.cs. |
|
Sets the dictionary which should be used in the deflate process. The dictionary is a byte array containing strings that are likely to occur in the data which should be compressed. The dictionary is not stored in the compressed output, only a checksum. To decompress the output you need to supply the same dictionary again.
Definition at line 542 of file Deflater.cs. |
|
Sets the dictionary which should be used in the deflate process. This call is equivalent to setDictionary(dict, 0, dict.Length)</code>.
Definition at line 517 of file Deflater.cs. |
|
Sets the data which should be compressed next. This should be only called when needsInput indicates that more input is needed. The given byte array should not be changed, before needsInput() returns true again.
Definition at line 336 of file Deflater.cs. |
|
Sets the data which should be compressed next. This should be only called when needsInput indicates that more input is needed. If you call setInput when needsInput() returns false, the previous input that is still pending will be thrown away. The given byte array should not be changed, before needsInput() returns true again. This call is equivalent to setInput(input, 0, input.length)</code>.
Definition at line 313 of file Deflater.cs. |
|
Sets the compression level. There is no guarantee of the exact position of the change, but if you call this when needsInput is true the change of compression level will occur somewhere near before the end of the so far given input.
Definition at line 353 of file Deflater.cs. |
|
Sets the compression strategy. Strategy is one of DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact position where the strategy is changed, the same as for setLevel() applies.
Definition at line 384 of file Deflater.cs. |
|
The best and slowest compression level. This tries to find very long and distant string repetitions.
Definition at line 61 of file Deflater.cs. |
|
The worst but fastest compression level.
Definition at line 66 of file Deflater.cs. |
|
Definition at line 127 of file Deflater.cs. |
|
Definition at line 131 of file Deflater.cs. |
|
The default compression level.
Definition at line 71 of file Deflater.cs. |
|
The compression method. This is the only method supported so far. There is no need to use this constant at all.
Definition at line 82 of file Deflater.cs. |
|
The deflater engine.
Definition at line 161 of file Deflater.cs. |
|
Definition at line 130 of file Deflater.cs. |
|
Definition at line 129 of file Deflater.cs. |
|
Definition at line 128 of file Deflater.cs. |
|
Definition at line 123 of file Deflater.cs. |
|
Definition at line 121 of file Deflater.cs. |
|
Definition at line 120 of file Deflater.cs. |
|
Definition at line 119 of file Deflater.cs. |
|
Compression level.
Definition at line 136 of file Deflater.cs. |
|
This level won't compress at all but output uncompressed blocks.
Definition at line 76 of file Deflater.cs. |
|
If true no Zlib/RFC1950 headers or footers are generated.
Definition at line 141 of file Deflater.cs. |
|
The pending output.
Definition at line 156 of file Deflater.cs. |
|
Definition at line 124 of file Deflater.cs. |
|
The current state.
Definition at line 146 of file Deflater.cs. |
|
The total bytes of output written.
Definition at line 151 of file Deflater.cs. |
|
Gets the current adler checksum of the data that was processed so far.
Definition at line 230 of file Deflater.cs. |
|
Returns true if the stream was finished and no more output bytes are available.
Definition at line 280 of file Deflater.cs. |
|
Returns true, if the input buffer is empty. You should then call setInput(). NOTE: This method can also return true when the stream was finished.
Definition at line 292 of file Deflater.cs. |
|
Gets the number of input bytes processed so far.
Definition at line 239 of file Deflater.cs. |
|
Gets the number of output bytes so far.
Definition at line 248 of file Deflater.cs. |