Compress a block of bytes to this stream using data from a buffer.
This method overrides Write.
The offset parameter gives the offset of the byte in array (the buffer index) at which to begin writing, and the count parameter gives the maximum number of bytes that will be compressed to this stream. If the comopress operation is successful, the current position of the stream is advanced by the number of bytes written. If an exception occurs, the current position of the stream is unchanged.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | array is a null reference (Nothing in Visual Basic). |
| ArgumentOutOfRangeException | offset or count is negative. |
| NotSupportedException | The stream does not support writing. |
| IOException | An I/O error occurs. |
| ArchiveCorruptedException | Compression error occurs. |
| ArgumentException | offset and count describe an invalid range in array. |
| ObjectDisposedException | Methods were called after the stream was closed. |
ZipStream Class | Resco.IO.Zip Namespace