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 gzip format).
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 \func{}{wxZlibInputStream
}{\param{wxInputStream*
}{ stream
},
\param{int
}{ flags = wxZLIB
\_AUTO}}
35 If the parent stream is passed as a pointer then the new filter stream
36 takes ownership of it. If it is passed by reference then it does not.
38 The
{\it flags
} wxZLIB
\_ZLIB and wxZLIB
\_GZIP specify whether the input data
39 is in zlib or gzip format. If wxZLIB
\_AUTO is used, then zlib will
40 autodetect the stream type, this is the default.
42 If
{\it flags
} is wxZLIB
\_NO\_HEADER, then the data is assumed to be a raw
43 deflate stream without either zlib or gzip headers. This is a lower level
44 mode, which is not usually used directly. It can be used to read a raw
45 deflate stream embedded in a higher level protocol.
47 %if WXWIN_COMPATIBILITY_2_4
48 This version is not by default compatible with the output produced by
49 the version of
{\it wxZlibOutputStream
} in wxWidgets
2.4.x. However,
50 there is a compatibility mode, which is switched on by passing
51 wxZLIB
\_24COMPATIBLE for flags. Note that in when operating in compatibility
52 mode error checking is very much reduced.
55 The following symbols can be use for the flags:
60 #if WXWIN_COMPATIBILITY_2_4
61 wxZLIB_24COMPATIBLE =
4, // read v2.4.x data without error
63 wxZLIB_NO_HEADER =
0, // raw deflate stream, no header or checksum
64 wxZLIB_ZLIB =
1, // zlib header and checksum
65 wxZLIB_GZIP =
2, // gzip header and checksum, requires zlib
1.2.1+
66 wxZLIB_AUTO =
3 // autodetect header zlib or gzip
70 \membersection{wxZlibInputStream::CanHandleGZip
}\label{wxzlibinputstreamcanhandlegzip
}
72 \func{static bool
}{CanHandleGZip
}{\void}
74 Returns true if zlib library in use can handle gzip compressed data.
76 % -----------------------------------------------------------------------------
78 % -----------------------------------------------------------------------------
79 \section{\class{wxZlibOutputStream
}}\label{wxzliboutputstream
}
81 This stream compresses all data written to it. The compressed output can be
82 in zlib or gzip format.
83 Note that writing the gzip format requires zlib version
1.2.1 or greater
84 (the builtin version does support gzip format).
86 The stream is not seekable,
\helpref{SeekO()
}{wxoutputstreamseeko
} returns
87 {\it wxInvalidOffset
}.
89 \wxheading{Derived from
}
91 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}
93 \wxheading{Include files
}
99 \helpref{wxOutputStream
}{wxoutputstream
},
100 \helpref{wxZlibInputStream
}{wxzlibinputstream
}
103 \latexignore{\rtfignore{\wxheading{Members
}}}
105 \membersection{wxZlibOutputStream::wxZlibOutputStream
}\label{wxzliboutputstreamwxzliboutputstream
}
107 \func{}{wxZlibOutputStream
}{\param{wxOutputStream\&
}{ stream
},
\param{int
}{ level = -
1},
\param{int
}{ flags = wxZLIB
\_ZLIB}}
109 \func{}{wxZlibOutputStream
}{\param{wxOutputStream*
}{ stream
},
\param{int
}{ level = -
1},
\param{int
}{ flags = wxZLIB
\_ZLIB}}
111 Creates a new write-only compressed stream.
{\it level
} means level of
112 compression. It is number between
0 and
9 (including these values) where
113 0 means no compression and
9 best but slowest compression. -
1 is default
114 value (currently equivalent to
6).
116 If the parent stream is passed as a pointer then the new filter stream
117 takes ownership of it. If it is passed by reference then it does not.
119 The
{\it flags
} wxZLIB
\_ZLIB and wxZLIB
\_GZIP specify whether the output data
120 will be in zlib or gzip format. wxZLIB
\_ZLIB is the default.
122 If
{\it flags
} is wxZLIB
\_NO\_HEADER, then a raw deflate stream is output
123 without either zlib or gzip headers. This is a lower level
124 mode, which is not usually used directly. It can be used to embed a raw
125 deflate stream in a higher level protocol.
127 The following symbols can be use for the compression level and flags:
132 wxZ_DEFAULT_COMPRESSION = -
1,
133 wxZ_NO_COMPRESSION =
0,
135 wxZ_BEST_COMPRESSION =
9
140 wxZLIB_NO_HEADER =
0, // raw deflate stream, no header or checksum
141 wxZLIB_ZLIB =
1, // zlib header and checksum
142 wxZLIB_GZIP =
2 // gzip header and checksum, requires zlib
1.2.1+
146 \membersection{wxZlibOutputStream::CanHandleGZip
}\label{wxoutputstreamcanhandlegzip
}
148 \func{static bool
}{CanHandleGZip
}{\void}
150 Returns true if zlib library in use can handle gzip compressed data.