# wxZlibInputStream Class Reference
[Archive support, Streams]

`#include </home/work/projects/wx/2.9/wx/interface/wx/zstream.h>`

Inheritance diagram for wxZlibInputStream:
[legend]

## Detailed Description

This filter stream decompresses a stream that is in zlib or gzip format.

Note that reading the gzip format requires zlib version 1.2.1 or greater, (the builtin version does support gzip format).

The stream is not seekable, wxInputStream::SeekI returns wxInvalidOffset. Also wxStreamBase::GetSize() is not supported, it always returns 0.

##

Library: wxBase
Category: Archive support, Streams

See also:
  wxInputStream, wxZlibOutputStream.

## Public Member Functions

| wxZlibInputStream (wxInputStream &stream, int flags=wxZLIB_AUTO)
| If the parent stream is passed as a pointer then the new filter stream takes ownership of it.
| wxZlibInputStream (wxInputStream *stream, int flags=wxZLIB_AUTO)
| If the parent stream is passed as a pointer then the new filter stream takes ownership of it.
bool | SetDictionary (const char *data, const size_t datalen)
| Sets the dictionary to the specified chunk of data.
bool | SetDictionary (const wxMemoryBuffer &buf)
| Sets the dictionary to the specified chunk of data.

## Static Public Member Functions

static bool | CanHandleGZip ()
| Returns true if zlib library in use can handle gzip compressed data.

List of all members.

## Constructor & Destructor Documentation

wxZlibInputStream::wxZlibInputStream | ( | wxInputStream & | stream,
|  | int | flags = `wxZLIB_AUTO` |
| ) |  |  |

If the parent stream is passed as a pointer then the new filter stream takes ownership of it.

If it is passed by reference then it does not.

The flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the input data is in zlib or gzip format. If wxZLIB_AUTO is used, then zlib will autodetect the stream type, this is the default.

If flags is wxZLIB_NO_HEADER, then the data is assumed to be a raw deflate stream without either zlib or gzip headers. This is a lower level mode, which is not usually used directly. It can be used to read a raw deflate stream embedded in a higher level protocol.

The values of the wxZLibFlags enumeration can be used.

wxZlibInputStream::wxZlibInputStream | ( | wxInputStream * | stream,
|  | int | flags = `wxZLIB_AUTO` |
| ) |  |  |

If the parent stream is passed as a pointer then the new filter stream takes ownership of it.

If it is passed by reference then it does not.

The flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the input data is in zlib or gzip format. If wxZLIB_AUTO is used, then zlib will autodetect the stream type, this is the default.

If flags is wxZLIB_NO_HEADER, then the data is assumed to be a raw deflate stream without either zlib or gzip headers. This is a lower level mode, which is not usually used directly. It can be used to read a raw deflate stream embedded in a higher level protocol.

The values of the wxZLibFlags enumeration can be used.

## Member Function Documentation

static bool wxZlibInputStream::CanHandleGZip | ( |  | ) | `[static]`

Returns true if zlib library in use can handle gzip compressed data.

bool wxZlibInputStream::SetDictionary | ( | const wxMemoryBuffer & | buf | ) |

Sets the dictionary to the specified chunk of data.

This can improve compression rate but note that the dictionary has to be the same when you deflate the data as when you inflate the data, otherwise you will inflate corrupted data.

Returns true if the dictionary was successfully set.

bool wxZlibInputStream::SetDictionary | ( | const char * | data,
|  | const size_t | datalen |
| ) |  |  |

Sets the dictionary to the specified chunk of data.

This can improve compression rate but note that the dictionary has to be the same when you deflate the data as when you inflate the data, otherwise you will inflate corrupted data.

Returns true if the dictionary was successfully set.

|  | [ top ]