mirror of
https://github.com/boostorg/iostreams.git
synced 2026-02-22 15:32:20 +00:00
108 lines
6.8 KiB
HTML
Executable File
108 lines
6.8 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Compression/Decompression</TITLE>
|
|
<LINK REL="stylesheet" HREF="../../../../boost.css">
|
|
<LINK REL="stylesheet" HREF="../theme/iostreams.css">
|
|
</HEAD>
|
|
<BODY>
|
|
|
|
<!-- Begin Banner -->
|
|
|
|
<H1 CLASS="title">Compression/Decompression</H1>
|
|
<HR CLASS="banner">
|
|
|
|
<!-- End Banner -->
|
|
|
|
<DL class="page-index">
|
|
<DT><A href="#overview">Overview</A></DT>
|
|
<DT><A href="#acknowledgments">Acknowledgments</A></DT>
|
|
<DT><A href="#headers">Headers</A></DT>
|
|
<DT><A href="#installation">Installation</A></DT>
|
|
<DT>Reference
|
|
<DL class="page-index">
|
|
<DT><A HREF="../classes/zlib.html">Zlib Filters</A></DT>
|
|
<DT><A HREF="../classes/gzip.html">Gzip Filters</A></DT>
|
|
<DT><A HREF="../classes/bzip2.html">Bzip2 Filters</A></DT>
|
|
</DL>
|
|
</DT>
|
|
</DL>
|
|
|
|
<A NAME="overview">
|
|
<H2>Overview</H2>
|
|
|
|
<P>
|
|
The Boost Iostreams library provides three pairs of Filters for compression/decompression. The class templates <A HREF="../classes/zlib.html#basic_zlib_compressor"><CODE>basic_zlib_compressor</CODE></A> and <A HREF="../classes/zlib.html#basic_zlib_decompressor"><CODE>basic_zlib_decompressor</CODE></A> perform compression and decompression in the Z<SPAN STYLE="font-size:80%">LIB</SPAN> format (<A CLASS="bib_ref" HREF="../bibliography.html#deutsch1">[Deutsch1]</A>) using Jean-loup Gailly's and Mark Adler's zlib compression library (<A CLASS="bib_ref" HREF="../bibliography.html#gailly">[Gailly]</A>). The class templates <A HREF="../classes/gzip.html#basic_gzip_compressor"><CODE>basic_gzip_compressor</CODE></A> and <A HREF="../classes/gzip.html#basic_gzip_decompressor"><CODE>basic_gzip_decompressor</CODE></A> perform compression and decompression in the G<SPAN STYLE="font-size:80%">ZIP</SPAN> format (<A CLASS="bib_ref" HREF="../bibliography.html#deutsch3">[Deutsch3]</A>), also using zlib. The class templates <A HREF="../classes/bzip2.html#basic_bzip2_compressor"><CODE>basic_bzip2_compressor</CODE></A> and <A HREF="../classes/bzip2.html#basic_bzip2_decompressor"><CODE>basic_bzip2_decompressor</CODE></A> perform compression and decompression in the B<SPAN STYLE="font-size:80%">ZIP2</SPAN> format using Julian Seward' libbzip2 compression library (<A CLASS="bib_ref" HREF="../bibliography.html#seward">[Seward]</A>).
|
|
</P>
|
|
<P>
|
|
All the compression/decompression Filters are <A HREF="../concepts/dual_use_filter.html">DualUseFilters</A> so that they may be used for either input or output.<A CLASS="footnote_ref" NAME="note_1_ref" HREF="#note_1"><SUP>[1]</SUP></A> Most commonly, however, the compression Filters will be used for output and the decompression Filters for input.
|
|
</P>
|
|
|
|
<A NAME="acknowledgments">
|
|
<H2>Acknowledgments</H2>
|
|
|
|
<P>
|
|
The compression/decompression Filters were influences by the work of Jeff Garland (<A CLASS="bib_ref" HREF="../bibliography.html#garland">[Garland]</A>) and Jonathan de Halleux (<A CLASS="bib_ref" HREF="../bibliography.html#de_halleux">[de Halleux]</A>). Thanks also to <A HREF="mailto:jloup@gailly.net">Jean-loup Gailly</A> and <A HREF="mailto:madler@alumni.caltech.edu">Mark Adler</A> and to <A HREF="mailto:jseward@acm.org">Julian Seward</A> for making their excellent librarys available to the public with <A HREF="../../../../more/lib_guide.htm#Requirements">Boost-compatible</A> licenses.
|
|
</P>
|
|
|
|
<!-- Adler's obfuscated address is copied from his homepage -->
|
|
|
|
<A NAME="headers">
|
|
<H2>Headers</H2>
|
|
|
|
<DL>
|
|
<DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/zlib.hpp"><CODE><boost/iostreams/filter/zlib.hpp></CODE></A></DT>
|
|
<DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/gzip.hpp"><CODE><boost/iostreams/filter/gzip.hpp></CODE></A></DT>
|
|
<DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/bzip2.hpp"><CODE><boost/iostreams/filter/bzip2.hpp></CODE></A></DT>
|
|
</DL>
|
|
|
|
<A NAME="installation">
|
|
<H2>Installation</H2>
|
|
|
|
<P>
|
|
The zlib and gzip Filters depend on the source file <A CLASS="header" HREF="../../src/zlib.cpp"><CODE><libs/src/zlib.cpp></CODE></A>. The bzip2 Filters depend on the source file <A CLASS="header" HREF="../../src/bzip2.cpp"><CODE><libs/src/bzip2.cpp></CODE></A>. These source files use several headers from the zlib and gzip libraries, included with the Iostreams library distribution in the directories <A CLASS="header" HREF="../../src/zlib"><CODE><libs/iostreams/src/zlib></CODE></A> and <A CLASS="header" HREF="../../src/bzip2"><CODE><libs/iostreams/src/bzip2></CODE></A>. Code using these filters must be linked against the zlib or libbzip2 binaries, which are available on most UNIX systems and which can be obtained for Windows systems here:
|
|
<UL>
|
|
<LI CLASS="square"><A HREF="http://www.gzip.org/zlib/contrib/index.html" TARGET="_top">zlib binaries (unofficial)</A>
|
|
<LI CLASS="square"><!-- <A HREF=""> -->libbzip2 binaries (currently broken)<!-- </A> -->
|
|
</UL>
|
|
Alternatively, the binaries can be build from the source code (<A CLASS="bib_ref" HREF="../bibliography.html#gailly">[Gailly]</A>, <A CLASS="bib_ref" HREF="../bibliography.html#deutsch2">[Seward]</A>).
|
|
</P>
|
|
|
|
<A NAME="other">
|
|
<H2>Other Compression Methods</H2>
|
|
|
|
<P>
|
|
It is easy to write Filters based on compression algorithms from other libraries, such as <A HREF="http://www.oberhumer.com/opensource/lzo/lzodoc.php" TARGET="_top">L<SPAN STYLE="font-size:80%">ZO</SPAN></A>, <A HREF="http://www.openssl.org" TARGET="_top">OpenSSL</A> and <A HREF="http://www.eskimo.com/~weidai/cryptlib.html" TARGET="_top">Crypto++</A>. No Filters using L<SPAN STYLE="font-size:80%">ZO</SPAN> or OpenSSL are supplied since their licenses are not <A HREF="../../../../more/lib_guide.htm#Requirements" TARGET="_top">Boost-compatible</A>. Most of Crypto++ is public domain, but providing Crypto++ filters would require including too many additional headers in the Iostreams library distribution.
|
|
</P>
|
|
|
|
<P>
|
|
In the future, additional compression methods may be added to the Iostreams library.
|
|
</P>
|
|
|
|
<!-- Begin Footnotes -->
|
|
|
|
<HR>
|
|
|
|
<P>
|
|
<A CLASS="footnote_ref" NAME="note_1" HREF="#note_1_ref"><SUP>[1]</SUP></A>Currently, <CODE>basic_gzip_decompressor</CODE> only models <A HREF="../concepts/input_filter.html">InputFilter</A>, but this will be fixed soon.
|
|
</P>
|
|
|
|
<!-- End Footnotes -->
|
|
|
|
<!-- Begin Footer -->
|
|
|
|
<HR>
|
|
<P CLASS="copyright">Revised
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
|
20 May, 2004
|
|
<!--webbot bot="Timestamp" endspan i-checksum="38504" -->
|
|
</P>
|
|
|
|
<P CLASS="copyright">© Copyright Jonathan Turkanis, 2004</P>
|
|
<P CLASS="copyright">
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <A HREF="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)
|
|
</P>
|
|
|
|
<!-- End Footer -->
|
|
|
|
</BODY> |