IP*Works! ZIP V9 - Online Help
IP*Works! ZIP V9
Questions / Feedback?

GetCompressionStream Method

Creates an output stream used to write compressed data.

Syntax

[VB.NET]
Public Function GetCompressionStream(ByVal BaseStream As System.IO.Stream) As System.IO.Stream
[C#]
public System.IO.Stream GetCompressionStream(System.IO.Stream baseStream);

Remarks

GetCompressionStream returns a System.IO.Stream used to compress data as it is written to an underlying stream. The BaseStream parameter should be the System.IO.Stream to which the compressed data will be written.

The format (zlib or gzip) is selected with the StreamFormat property; zlib is the default.

The return value provides the following standard System.IO.Stream methods. Please see the official .NET Framework documentation for details.

public bool CanWrite { get }

Returns true.

public void Close()

Closes the stream. Also closes BaseStream if CloseBaseStream is set to true before this stream is created.

public void Flush()

Flushes the output stream, and forces all data to be compressed and written to the underlying stream. Caution: Flush only when necessary, as repeated flushing may degrade the compression ratio.

public void WriteByte(byte b)

Compresses and writes the byte b to the underlying stream.

public void Write(byte[] b, int off, int len)

Compresses and writes the byte array b to the underlying stream.

Other System.IO.Stream methods will throw a NotSupportedException.

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
Build 9.0.6240.0