# Poco

# class DeflatingStreamBuf

Library: Foundation
Package: Streams
Header: Poco/DeflatingStream.h

## Description

This is the streambuf class used by DeflatingInputStream and DeflatingOutputStream. The actual work is delegated to zlib 1.2.1 (see http://www.gzip.org). Both zlib (deflate) streams and gzip streams are supported. Output streams should always call close() to ensure proper completion of compression. A compression level (0 to 9) can be specified in the constructor.

## Inheritance

Direct Base Classes: BufferedStreamBuf

All Base Classes: BufferedStreamBuf

## Member Summary

Member Functions: close, readFromDevice, writeToDevice

## Enumerations

### StreamType

STREAM_ZLIB

STREAM_GZIP

## Constructors

### DeflatingStreamBuf

DeflatingStreamBuf(
std::istream & istr,
StreamType type,
int level
);

### DeflatingStreamBuf

DeflatingStreamBuf(
std::ostream & ostr,
StreamType type,
int level
);

## Destructor

### ~DeflatingStreamBuf

~DeflatingStreamBuf();

## Member Functions

### close

int close();

### readFromDevice

int readFromDevice(
char * buffer,
std::streamsize length
);

### writeToDevice

int writeToDevice(
const char * buffer,
std::streamsize length
);