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 available in Javausing the java.util.zip package:
http://java.sun.com/developer/technicalAr ticles/Programming/compression/
APer l interface to zlib,written byPaul Marquess (pmqs@cpan.org), is available at CPAN (Com-
prehensivePer l ArchiveNetwor k) sites,including:
http://search.cpan.org/˜pmqs/IO-Compress-Zlib/
APython interface to zlib,written byA.M. Kuchling (amk@magnet.com), is available in Python
1.5 and later versions:
http://docs.python.org/librar y/zlib.html
zlib is built into tcl:
http://wiki.tcl.tk/4610
An exper imental package to read and write files in .zip for mat, wr itten on top of zlib by Gilles Vol-
lant (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:
28 Apr 2013 1
评论1