public inflate ( FlushStrategy flush ) : int | ||
flush | FlushStrategy | |
return | 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 (avail_out == 0
), or after each call of inflate. If inflate returns ZLibResultCode.Z_OK and with zero avail_out, it must be called again after making room in the
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.
public inflate ( FlushStrategy flush ) : int | ||
flush | FlushStrategy | |
return | int |