3rd Eye Scene C#
3rd Eye Scene C# documentation
|
Implements a MemoryStream
wrapper to support GZip compression.
More...
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] |
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.
Tes::IO::ReusableMemoryStream::ReusableMemoryStream | ( | int | capacity | ) | [inline] |
Create a compression buffer with the given initial capacity.
capacity | The initial capacity in bytes. |