3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::IO::ReusableMemoryStream Class Reference

Implements a MemoryStream wrapper to support GZip compression. More...

List of all members.

Public Member Functions

 ReusableMemoryStream (int capacity)
 Create a compression buffer with the given initial capacity.
byte[] GetBuffer ()
override void Close ()
override void Flush ()
override int Read (byte[] buffer, int offset, int count)
override long Seek (long offset, SeekOrigin origin)
override void SetLength (long value)
override void Write (byte[] buffer, int offset, int count)

Properties

override bool CanRead [get]
override bool CanSeek [get]
override bool CanWrite [get]
override long Length [get]
override long Position [get, set]

Detailed Description

Implements a MemoryStream wrapper to support GZip compression.

This class is a workaround for how GZipStream needs to be finalised and closes its wrapped stream.

GZipStream compression works by wrapping another stream. The compression stream is not finalised until the GZipStream is closed. Doing so closes the stream wrapped by the zip stream. This makes it impossible to access the written byte count in the memory stream or to reuse the stream.

Most members are simply a pass through to the underlying MemoryStream. However the Close() function flushes the buffer, but leaves the MemoryStream open. In this way, the MemoryStream can continue to be used.


Constructor & Destructor Documentation

Tes::IO::ReusableMemoryStream::ReusableMemoryStream ( int  capacity) [inline]

Create a compression buffer with the given initial capacity.

Parameters:
capacityThe initial capacity in bytes.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events