CompressionStream Class
Namespace: Rebex.IO.Compression.Streams
Assembly: Rebex.Zip.dll (version 7.0.9083)
Provides a stream that uses specified compressed data format to compress data. If opened for writing it compresses specified data and writes the compressed data into an underlying stream. If opened for reading it reads an uncompressed data from the underlying stream and returns a compressed data. 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.
Syntax
public class CompressionStream : Stream, IAsyncDisposable, IDisposable
Inherited Members
Constructors
Name | Description |
---|---|
CompressionStream(Stream, OpenMode, CompressionFormat, CompressionMethod) | Creates a new instance of CompressionStream class. |
CompressionStream(Stream, OpenMode, CompressionFormat, CompressionMethod, Int32) | Creates a new instance of CompressionStream class. |
Fields
Name | Description |
---|---|
DefaultCompressionLevel | The default compression level. |
Properties
Name | Description |
---|---|
CanRead | Gets a value indicating whether the stream supports reading. |
CanSeek | Gets a value indicating whether the stream supports seeking. |
CanWrite | Gets a value indicating whether the stream supports writing. |
Length | This property is not supported by the CompressionStream class. |
Position | This property is not supported by the CompressionStream class. |
Methods
Name | Description |
---|---|
Dispose(Boolean) | Closes the underlying stream. |
Flush() | Causes any buffered data to be written to the underlying stream. |
Read(Byte[], Int32, Int32) | Reads data from the underlying stream, compressing them during the process. |
Seek(Int64, SeekOrigin) | This method is not supported by the CompressionStream class. |
SetLength(Int64) | This method is not supported by the CompressionStream class. |
Write(Byte[], Int32, Int32) | Writes a sequence of bytes into the stream. The sequence will be compressed and the result written into the underlying stream. |