Property | Type | Description |
---|
Method | Description | |
---|---|---|
deflate ( FlushStrategy flush ) : int |
Deflate compresses as much data as possible, and stops when the The detailed semantics are as follows. deflate performs one or both of the following actions: Before the call of If the parameter flush is set to FlushStrategy.Z_SYNC_FLUSH, all pending output is flushed to the If flush is set to FlushStrategy.Z_FULL_FLUSH, all output is flushed as with FlushStrategy.Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using FlushStrategy.Z_FULL_FLUSH too often can seriously degrade the compression. |
|
deflateEnd ( ) : int |
All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output.
|
|
deflateInit ( int level ) : int |
Initializes the internal stream state for compression.
|
|
deflateInit ( int level, int bits ) : int |
Initializes the internal stream state for compression.
|
|
deflateParams ( int level, CompressionStrategy strategy ) : int |
Dynamically update the compression level and compression strategy. The interpretation of level is as in deflateInit(int). This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate Before the call of deflateParams, the stream state must be set as for a call of deflate, since the currently available input may have to be compressed and flushed. In particular, avail_out must be non-zero. |
|
deflateSetDictionary ( byte dictionary, int dictLength ) : int |
Initializes the compression dictionary from the given byte sequence without producing any compressed output. This function must be called immediately after deflateInit(int), before any call of deflate. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit(int), a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size in deflate. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. Upon return of this function, adler is set to the Adler32 value of the dictionary; the decompresser may later use this value to determine which dictionary has been used by the compressor. (The Adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) |
|
flush_pending ( ) : void |
Flush as much pending output as possible. All deflate output goes through this function so some applications may wish to modify it to avoid allocating a large next_out buffer and copying into it.
|
|
free ( ) : void |
Frees all inner ZStream buffers.
|
|
inflate ( FlushStrategy flush ) : int |
This method decompresses as much data as possible, and stops when the input buffer (next_in) becomes empty or the output buffer (next_out) becomes full. It may some introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: Before the call of inflate, the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full ( If the parameter flush is set to FlushStrategy.Z_SYNC_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is not specified for values of the flush parameter other than FlushStrategy.Z_SYNC_FLUSH and FlushStrategy.Z_FINISH, but the current implementation actually flushes as much output as possible anyway. inflate should normally be called until it returns ZLibResultCode.Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to FlushStrategy.Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of FlushStrategy.Z_FINISH is never required, but can be used to inform inflate that a faster routine may be used for the single inflate call. If a preset dictionary is needed at this point (see inflateSetDictionary), inflate sets strm-adler to the adler32 checksum of the dictionary chosen by the compressor and returns ZLibResultCode.Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns ZLibResultCode.Z_OK, ZLibResultCode.Z_STREAM_END or an error code as described below. At the end of the stream, inflate) checks that its computed adler32 checksum is equal to that saved by the compressor and returns ZLibResultCode.Z_STREAM_END only if the checksum is correct. |
|
inflateEnd ( ) : int |
All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output.
|
|
inflateInit ( ) : int |
Initializes the internal stream state for decompression. The fields next_in, avail_in must be initialized before by the caller. If next_in is not
|
|
inflateInit ( int windowBits ) : int |
This is another version of inflateInit() with an extra parameter. The fields next_in, avail_in must be initialized before by the caller. If next_in is not
|
|
inflateSetDictionary ( byte dictionary, int dictLength ) : int |
Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate if this call returned ZLibResultCode.Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler32 value returned by this call of inflate. The compressor and decompresser must use exactly the same dictionary.
|
|
inflateSync ( ) : int |
Skips invalid compressed data until a full flush point (see the description of
|
|
read_buf ( byte buf, int start, int size ) : int |
Read a new buffer from the current input stream, update the adler32 and total number of bytes read. All deflate input goes through this function so some applications may wish to modify it to avoid allocating a large next_in buffer and copying from it.
|
public deflate ( FlushStrategy flush ) : int | ||
flush | FlushStrategy | The |
return | int |
public deflateInit ( int level ) : int | ||
level | int | An integer value from 0 to 9 indicating the desired compression level. |
return | int |
public deflateInit ( int level, int bits ) : int | ||
level | int | An integer value from 0 to 9 indicating the desired compression level. |
bits | int | The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the /// range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. /// The default value is 15 if deflateInit is used instead. |
return | int |
public deflateParams ( int level, CompressionStrategy strategy ) : int | ||
level | int | An integer value indicating the desired compression level. |
strategy | CompressionStrategy | A |
return | int |
public deflateSetDictionary ( byte dictionary, int dictLength ) : int | ||
dictionary | byte | A byte array - a dictionary. |
dictLength | int | The length of the dictionary byte array |
return | int |
public inflate ( FlushStrategy flush ) : int | ||
flush | FlushStrategy | |
return | int |
public inflateInit ( int windowBits ) : int | ||
windowBits | int | The |
return | int |
public inflateSetDictionary ( byte dictionary, int dictLength ) : int | ||
dictionary | byte | A byte array - a dictionary. |
dictLength | int | The length of the dictionary. |
return | int |
public read_buf ( byte buf, int start, int size ) : int | ||
buf | byte | |
start | int | |
size | int | |
return | int |