ocean.io.compress.ZlibStream

Simple zlib / gzip stream decompressor.

Decompresses a stream of data which is received in one or more chunks. The decompressed data is passed to a provided delegate.

Needs linking with -lz.

Usage example:

import ocean.io.compress.ZlibStream;

auto decompress = new ZlibStreamDecompressor;

ubyte[] decompressed_data;

decompress.start(ZlibStreamDecompressor.Encoding.Zlib);

// Hypothetical function which receives chunks of compressed data.
receiveData(
    ( ubyte[] compressed_chunk )
    {
        decompress.decodeChunk(compressed_chunk,
            ( ubyte[] decompressed_chunk )
            {
                decompressed_data ~= decompressed_chunk;
            });
    });

decompress.end();

Members

Classes

ZlibStreamDecompressor
class ZlibStreamDecompressor

Simple zlib stream decompressor.

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).

Bear in mind this module provides bindings to an external library that has its own license, which might be more restrictive. Please check the external library license to see which conditions apply for linking.