1 % -----------------------------------------------------------------------------
3 % -----------------------------------------------------------------------------
4 \section{\class{wxZlibInputStream
}}\label{wxzlibinputstream
}
6 This filter stream decompresses a stream that is in zlib or gzip format.
7 Note that reading the gzip format requires zlib version
1.2.1 or greater,
8 (the builtin version does support gzips).
10 The stream is not seekable,
\helpref{SeekI()
}{wxinputstreamseeki
} returns
11 {\it wxInvalidOffset
}. Also
\helpref{GetSize()
}{wxstreambasegetsize
} is
12 not supported, it always returns $
0$.
14 \wxheading{Derived from
}
16 \helpref{wxFilterInputStream
}{wxfilterinputstream
}
18 \wxheading{Include files
}
24 \helpref{wxInputStream
}{wxinputstream
},
25 \helpref{wxZlibOutputStream
}{wxzliboutputstream
}.
27 \latexignore{\rtfignore{\wxheading{Members
}}}
29 \membersection{wxZlibInputStream::wxZlibInputStream
}\label{wxzlibinputstreamwxzlibinputstream
}
31 \func{}{wxZlibInputStream
}{\param{wxInputStream\&
}{ stream
},
\param{int
}{ flags = wxZLIB
\_AUTO}}
33 The
{\it flags
} wxZLIB
\_ZLIB and wxZLIB
\_GZIP specify whether the input data
34 is in zlib or gzip format. If wxZLIB
\_AUTO is used, then zlib will
35 autodetect the stream type, this is the default.
37 If
{\it flags
} is wxZLIB
\_NO\_HEADER, then the data is assumed to be a raw
38 deflate stream without either zlib or gzip headers. This is a lower level
39 mode, which is not usually used directly. It can be used to read a raw
40 deflate stream embedded in a higher level protocol.
42 %if WXWIN_COMPATIBILITY_2_4
43 This version is not by default compatible with the output produced by
44 the version of
{\it wxZlibOutputStream
} in wxWidgets
2.4.x. However,
45 there is a compatibilty mode, which is switched on by passing
46 wxZLIB
\_24COMPATIBLE for flags. Note that in when operating in compatibilty
47 mode error checking is very much reduced.
50 The following symbols can be use for the flags:
55 #if WXWIN_COMPATIBILITY_2_4
56 wxZLIB_24COMPATIBLE =
4, // read v2.4.x data without error
58 wxZLIB_NO_HEADER =
0, // raw deflate stream, no header or checksum
59 wxZLIB_ZLIB =
1, // zlib header and checksum
60 wxZLIB_GZIP =
2, // gzip header and checksum, requires zlib
1.2.1+
61 wxZLIB_AUTO =
3 // autodetect header zlib or gzip
65 \membersection{wxZlibInputStream::CanHandleGZip
}\label{wxzlibinputstreamcanhandlegzip
}
67 \func{static bool
}{CanHandleGZip
}{\void}
69 Returns true if zlib library in use can handle gzip compressed data.
71 % -----------------------------------------------------------------------------
73 % -----------------------------------------------------------------------------
74 \section{\class{wxZlibOutputStream
}}\label{wxzliboutputstream
}
76 This stream compresses all data written to it. The compressed output can be
77 in zlib or gzip format.
78 Note that writing the gzip format requires zlib version
1.2.1 or greater
79 (the builtin version does support gzips).
81 The stream is not seekable,
\helpref{SeekO()
}{wxoutputstreamseeko
} returns
82 {\it wxInvalidOffset
}.
84 \wxheading{Derived from
}
86 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}
88 \wxheading{Include files
}
94 \helpref{wxOutputStream
}{wxoutputstream
},
95 \helpref{wxZlibInputStream
}{wxzlibinputstream
}
98 \latexignore{\rtfignore{\wxheading{Members
}}}
100 \membersection{wxZlibOutputStream::wxZlibOutputStream
}\label{wxzliboutputstreamwxzliboutputstream
}
102 \func{}{wxZlibOutputStream
}{\param{wxOutputStream\&
}{ stream
},
\param{int
}{ level = -
1},
\param{int
}{ flags = wxZLIB
\_ZLIB}}
104 Creates a new write-only compressed stream.
{\it level
} means level of
105 compression. It is number between
0 and
9 (including these values) where
106 0 means no compression and
9 best but slowest compression. -
1 is default
107 value (currently equivalent to
6).
109 The
{\it flags
} wxZLIB
\_ZLIB and wxZLIB
\_GZIP specify whether the output data
110 will be in zlib or gzip format. wxZLIB
\_ZLIB is the default.
112 If
{\it flags
} is wxZLIB
\_NO\_HEADER, then a raw deflate stream is output
113 without either zlib or gzip headers. This is a lower level
114 mode, which is not usually used directly. It can be used to embed a raw
115 deflate stream in a higher level protocol.
117 The following symbols can be use for the compression level and flags:
122 wxZ_DEFAULT_COMPRESSION = -
1,
123 wxZ_NO_COMPRESSION =
0,
125 wxZ_BEST_COMPRESSION =
9
130 wxZLIB_NO_HEADER =
0, // raw deflate stream, no header or checksum
131 wxZLIB_ZLIB =
1, // zlib header and checksum
132 wxZLIB_GZIP =
2 // gzip header and checksum, requires zlib
1.2.1+
136 \membersection{wxZlibOutputStream::CanHandleGZip
}\label{wxoutputstreamcanhandlegzip
}
138 \func{static bool
}{CanHandleGZip
}{\void}
140 Returns true if zlib library in use can handle gzip compressed data.