ZlibOutput

This output filter can be used to perform compression of data into a zlib stream.

Constructors

this
this(OutputStream stream, Level level, Encoding encoding, int windowBits)
this(OutputStream stream, Level level)

Constructs a new zlib compression filter. You need to pass in the stream that the compression filter will write to. If you are using this filter with a conduit, the idiom to use is:

Destructor

~this
~this()
Undocumented in source.

Members

Enums

Encoding
enum Encoding

This enumeration allows you to specify what the encoding of the compressed stream should be.

Level
enum Level

This enumeration represents several pre-defined compression levels.

Functions

close
void close()

Close the compression stream. This will cause any buffered content to be committed to the underlying stream.

commit
void commit()

Purge any buffered content. Calling this will implicitly end the zlib stream, so it should not be called until you are finished compressing data. Any calls to either write or commit after a compression filter has been committed will throw an exception.

reset
void reset(OutputStream stream, Level level, Encoding encoding, int windowBits)
void reset(OutputStream stream, Level level)

Resets and re-initialises this instance.

seek
long seek(long offset, Anchor anchor)
Undocumented in source. Be warned that the author may not have intended to support it.
write
size_t write(const(void)[] src)

Compresses the given data to the underlying conduit.

written
size_t written()

This read-only property returns the number of compressed bytes that have been written to the underlying stream. Following a call to either close or commit, this will contain the total compressed size of the input data stream.

Inherited Members

From OutputFilter

sink
OutputStream sink;
Undocumented in source.
conduit
IConduit conduit [@property getter]

Return the hosting conduit.

write
size_t write(const(void)[] src)

Write to conduit from a source array. The provided src content will be written to the conduit.

copy
OutputStream copy(InputStream src, size_t max)

Transfer the content of another conduit to this one. Returns a reference to this class, or throws IOException on failure.

flush
IOStream flush()

Emit/purge buffered content.

seek
long seek(long offset, Anchor anchor)

Seek on this stream. Target conduits that don't support seeking will throw an IOException.

output
OutputStream output [@property getter]

Return the upstream host of this filter.

close
void close()

Close the output.

Meta