Table of Contents

Class ZOutputStream

Namespace
Org.BouncyCastle.Utilities.Zlib
Assembly
BouncyCastle.Cryptography.dll
public class ZOutputStream : BaseOutputStream, IAsyncDisposable, IDisposable
Inheritance
ZOutputStream
Implements
Derived
Inherited Members

Constructors

ZOutputStream(Stream)

public ZOutputStream(Stream output)

Parameters

output Stream

ZOutputStream(Stream, ZStream)

public ZOutputStream(Stream output, ZStream z)

Parameters

output Stream
z ZStream

ZOutputStream(Stream, bool)

public ZOutputStream(Stream output, bool nowrap)

Parameters

output Stream
nowrap bool

ZOutputStream(Stream, int)

public ZOutputStream(Stream output, int level)

Parameters

output Stream
level int

ZOutputStream(Stream, int, bool)

public ZOutputStream(Stream output, int level, bool nowrap)

Parameters

output Stream
level int
nowrap bool

Fields

buf

protected byte[] buf

Field Value

byte[]

buf1

protected byte[] buf1

Field Value

byte[]

closed

protected bool closed

Field Value

bool

compress

protected bool compress

Field Value

bool

flushLevel

protected int flushLevel

Field Value

int

output

protected Stream output

Field Value

Stream

z

protected ZStream z

Field Value

ZStream

Properties

FlushMode

public virtual int FlushMode { get; set; }

Property Value

int

TotalIn

public virtual long TotalIn { get; }

Property Value

long

TotalOut

public virtual long TotalOut { get; }

Property Value

long

Methods

Detach(bool)

protected void Detach(bool disposing)

Parameters

disposing bool

Dispose(bool)

Releases the unmanaged resources used by the Stream and optionally releases the managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

End()

public virtual void End()

Finish()

public virtual void Finish()

Flush()

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.

public override void Flush()

Exceptions

IOException

An I/O error occurs.

Write(byte[], int, int)

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

public override void Write(byte[] buffer, int offset, int count)

Parameters

buffer byte[]

An array of bytes. This method copies count bytes from buffer to the current stream.

offset int

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

count int

The number of bytes to be written to the current stream.

Exceptions

ArgumentException

The sum of offset and count is greater than the buffer length.

ArgumentNullException

buffer is null.

ArgumentOutOfRangeException

offset or count is negative.

IOException

An I/O error occurred, such as the specified file cannot be found.

NotSupportedException

The stream does not support writing.

ObjectDisposedException

Write(byte[], int, int) was called after the stream was closed.

WriteByte(byte)

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

public override void WriteByte(byte value)

Parameters

value byte

The byte to write to the stream.

Exceptions

IOException

An I/O error occurs.

NotSupportedException

The stream does not support writing, or the stream is already closed.

ObjectDisposedException

Methods were called after the stream was closed.