ZLIB(3) ZLIB(3)
NAME
zlib − compression/decompression librar y
SYNOPSIS
[see zlib.h forfull description]
DESCRIPTION
The zlib librar y is a general purpose data compression librar y.The code is thread safe, assuming
that the standard librar y functions used are thread safe, such as memoryallocation routines.It
provides in-memorycompression and decompression functions,including integrity checks of the
uncompressed data. This version of the librar y suppor ts only one compression method (defla-
tion) but other algorithms maybeadded later with the same stream interface.
Compression can be done in a single step if the buffers are large enough or can be done by
repeated calls of the compression function. In the latter case,the application must provide more
input and/or consume the output (providing more output space) before each call.
The librar y also supports reading and writing files in gzip(1) (.gz) for mat with an interface similar
to that of stdio.
The librar y does not install anysignal handler.The decoder checks the consistency of the com-
pressed data, so the librar y should nevercrash eveninthe case of corrupted input.
All functions of the compression librar y are documented in the file zlib.h.The distribution source
includes examples of use of the librar y in the files test/example.c and test/minigzip.c, as well as
other examples in the examples/ director y.
Changes to this version are documented in the file ChangeLog that accompanies the source.
zlib is built in to manylanguages and operating systems,including but not limited to Java, Python,
.NET,PHP,Per l, Ruby, Swift, and Go.
An exper imental package to read and write files in the .zip for mat, wr itten on top of zlib by Gilles
Vollant (info@winimage.com), is available at:
http://www.winimage.com/zLibDll/minizip.html and also in the contr ib/minizip director y of
the main zlib source distribution.
SEE ALSO
The zlib website can be found at:
http://zlib.net/
The data for mat used bythe zlib librar y is described byRFC (Request for Comments) 1950 to
1952 in the files:
http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer for mat)
http://tools.ietf.org/html/rfc1951 (for the deflate compressed data for mat)
http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer for mat)
Mar k Nelson wrote an article about zlib forthe Jan. 1997 issue of Dr.Dobb’sJour nal; acopyof
the article is available at:
http://mar knelson.us/1997/01/01/zlib-engine/
REPORTING PROBLEMS
Before reporting a problem, please checkthe zlib website to ver ify that you have the latest ver-
sion of zlib;otherwise,obtain the latest version and see if the problem still exists.Please read
the zlib FA Q at:
http://zlib.net/zlib_faq.html
before asking for help.Send questions and/or comments to zlib@gzip.org, or (for the Windows
DLL version) to Gilles Vollant (info@winimage.com).
15 Jan 2017 1