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
outputStream
ZOutputStream(Stream, ZStream)
public ZOutputStream(Stream output, ZStream z)
Parameters
ZOutputStream(Stream, bool)
public ZOutputStream(Stream output, bool nowrap)
Parameters
ZOutputStream(Stream, int)
public ZOutputStream(Stream output, int level)
Parameters
ZOutputStream(Stream, int, bool)
public ZOutputStream(Stream output, int level, bool nowrap)
Parameters
Fields
buf
protected byte[] buf
Field Value
- byte[]
buf1
protected byte[] buf1
Field Value
- byte[]
closed
protected bool closed
Field Value
compress
protected bool compress
Field Value
flushLevel
protected int flushLevel
Field Value
output
protected Stream output
Field Value
z
protected ZStream z
Field Value
Properties
FlushMode
public virtual int FlushMode { get; set; }
Property Value
TotalIn
public virtual long TotalIn { get; }
Property Value
TotalOut
public virtual long TotalOut { get; }
Property Value
Methods
Detach(bool)
protected void Detach(bool disposing)
Parameters
disposingbool
Dispose(bool)
Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue 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
bufferbyte[]An array of bytes. This method copies
countbytes frombufferto the current stream.offsetintThe zero-based byte offset in
bufferat which to begin copying bytes to the current stream.countintThe number of bytes to be written to the current stream.
Exceptions
- ArgumentException
The sum of
offsetandcountis greater than the buffer length.- ArgumentNullException
bufferis null.- ArgumentOutOfRangeException
offsetorcountis 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
valuebyteThe 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.