gzflush — The gzflush() function shall flush pending output to the compressed file stream identified by file, which must be open for writing.
#include <zlib.h>
int gzflush(gzFile file, int flush);
On success, gzflush()
shall return the
value
Z_OK.
Otherwise gzflush() shall return
a value to indicate the error, and may set the error number
associated with the compressed file stream file.
Note: If flush is set to
Z_FINISH
and the flush operation is successful, gzflush() will return Z_OK, but the compressed file stream error value may be set toZ_STREAM_END
.
The gzflush()
function shall flush
pending
output to the compressed file stream identified by
file, which must be open for writing.
#include <stdio.h> |
The parameter flush
determines
which compressed bits are added to the output file.
If flush is Z_NO_FLUSH
,
gzflush()
may return with some data pending output, and not yet written to the
file.
If flush
is Z_SYNC_FLUSH
,
gzflush() shall flush all pending output to
file and align the output to a byte
boundary.
There may still be data pending compression that is not flushed.
If flush
is Z_FULL_FLUSH
,
all output shall be flushed, as for Z_SYNC_FLUSH
,
and the compression state shall be reset.
There may still be data pending compression that is not flushed.
Note:
Z_SYNC_FLUSH
is intended to ensure that the compressed data contains all the data compressed so far, and allows a de-compressor to reconstruct all of the input data.Z_FULL_FLUSH
allows decompression to restart from this point if the previous compressed data has been lost or damaged. Flushing is likely to degrade the performance of the compression system, and should only be used where necessary.
If flush
is set to Z_FINISH
,
all pending uncompressed data shall be compressed
and all output shall be flushed.
On error, gzflush() shall return an error value, and may set the error number associated with the stream identified by file to indicate the error. Applications may use gzerror() to access this error value.
For additional information or queries on this page send feedback
© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |