C# Класс Rebex.IO.Compression.ZlibOutputStream

Provides a writable stream that uses ZLIB algorithm to either compresses or decompresses data written to it and saves the resulting data blocks into an underlying stream. Unlike similar class present in .NET Framework 2.0, this one actually makes it possible to use Flush when compressing data to make sure all data written to the stream have been written into the underlying stream as well.
Наследование: Stream
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Closes the current stream and the underlying stream.

Flush ( ) : void

Causes any buffered data to be written to the underlying stream.

Read ( byte buffer, int offset, int count ) : int

This method is not supported by the ZlibOutputStream class.

Seek ( long offset, SeekOrigin origin ) : long

This method is not supported by the ZlibOutputStream class.

The new position within the current stream.

SetLength ( long value ) : void

This method is not supported by the ZlibOutputStream class.

Write ( byte buffer, int offset, int count ) : void

Writes a sequence of bytes into the current stream. The sequence will be compressed or decompressed and the result written into the underlying stream.

ZlibOutputStream ( Stream output, CompressionMode mode ) : System

Creates a new instance of ZlibOutputStream class.

ZlibOutputStream ( Stream output, CompressionMode mode, int level ) : System

Creates a new instance of ZlibOutputStream class.

ZlibOutputStream ( Stream output, bool compress, int level ) : System

Creates a new instance of ZlibOutputStream class.

Приватные методы

Метод Описание
WriteInternal ( byte buffer, int offset, int count, int flush ) : void

Описание методов

Close() публичный Метод

Closes the current stream and the underlying stream.
public Close ( ) : void
Результат void

Flush() публичный Метод

Causes any buffered data to be written to the underlying stream.
public Flush ( ) : void
Результат void

Read() публичный Метод

This method is not supported by the ZlibOutputStream class.
public Read ( byte buffer, int offset, int count ) : int
buffer byte An array of bytes. This method reads count bytes from buffer to the current stream.
offset int The zero-based byte offset in buffer at which to begin writing bytes to the current stream.
count int The number of bytes to be written to the current stream.
Результат int

Seek() публичный Метод

This method is not supported by the ZlibOutputStream class.
The new position within the current stream.
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the origin parameter.
origin SeekOrigin A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.
Результат long

SetLength() публичный Метод

This method is not supported by the ZlibOutputStream class.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
Результат void

Write() публичный Метод

Writes a sequence of bytes into the current stream. The sequence will be compressed or decompressed and the result written into the underlying stream.
public Write ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes. This method writes count bytes from buffer to the current stream.
offset int The zero-based byte offset in buffer at which to begin writing bytes to the current stream.
count int The number of bytes to be written to the current stream.
Результат void

ZlibOutputStream() публичный Метод

Creates a new instance of ZlibOutputStream class.
public ZlibOutputStream ( Stream output, CompressionMode mode ) : System
output Stream Underlying stream that will receive the processed data written to the instance.
mode CompressionMode Specifies whether to compress or decompress data written to the stream.
Результат System

ZlibOutputStream() публичный Метод

Creates a new instance of ZlibOutputStream class.
public ZlibOutputStream ( Stream output, CompressionMode mode, int level ) : System
output Stream Underlying stream that will receive the processed data written to the instance.
mode CompressionMode Specifies whether to compress or decompress data written to the stream.
level int Compresion level. Only used when compressing data.
Результат System

ZlibOutputStream() публичный Метод

Creates a new instance of ZlibOutputStream class.
public ZlibOutputStream ( Stream output, bool compress, int level ) : System
output Stream Underlying stream that will receive the processed data written to the instance.
compress bool True to compress, false to decompress data written to the stream.
level int Compression level. Only used when compressing data.
Результат System