3rd Eye Scene C#
3rd Eye Scene C# documentation
|
A stream implementation which uses a T:IO.CollatedPacketEncoder to compress data before writing to another stream. More...
Public Member Functions | |
CollationStream (Stream baseStream, bool compress=true) | |
Createa a collation stream wrapping baseStream . | |
override void | Flush () |
Flush the collation buffer and the underlying stream. | |
override int | Read (byte[] buffer, int offset, int count) |
Not suypported. | |
override long | Seek (long offset, SeekOrigin origin) |
Not supported. | |
override void | SetLength (long value) |
Not supported. | |
override void | Write (byte[] buffer, int offset, int count) |
Writes and compresses data to the collation buffer. | |
Properties | |
bool | CompressionEnabled [get, set] |
Toggle compression. | |
Stream | BaseStream [get, set] |
The underlying stream to write to. | |
override bool | CanRead [get] |
false | |
override bool | CanSeek [get] |
false | |
override bool | CanWrite [get] |
false | |
override long | Length [get] |
Returns the number of bytes written plus the oustanding buffered bytes. | |
override long | Position [get, set] |
Get returns the number of bytes written plus the oustanding buffered bytes. |
A stream implementation which uses a T:IO.CollatedPacketEncoder to compress data before writing to another stream.
This is intended for compressing T:PacketBuffer data to a FileStream
. Compression is implemented in chunks using the T:IO.CollatedPacketEncoder and is implicitly enabled. No data other than T:PacketBuffer data should be written to this stream.
Compression may be temporarily disabled by setting CompressionEnabled to false
. This will flush the current buffer then cause Write(byte[], int, int) calls to write directly to the BaseStream.
Tes::IO::CollationStream::CollationStream | ( | Stream | baseStream, |
bool | compress = true |
||
) | [inline] |
Createa a collation stream wrapping baseStream .
baseStream | The stream to write into after collation. |
compress | Enable compression? Otherwise we collated without compression. |
override int Tes::IO::CollationStream::Read | ( | byte[] | buffer, |
int | offset, | ||
int | count | ||
) | [inline] |
Not suypported.
buffer | Ignored. |
offset | Ignored. |
count | Ignored. |
override long Tes::IO::CollationStream::Seek | ( | long | offset, |
SeekOrigin | origin | ||
) | [inline] |
Not supported.
offset | Ignored. |
origin | Ignored. |
override void Tes::IO::CollationStream::SetLength | ( | long | value | ) | [inline] |
Not supported.
value | Ignored. |
override void Tes::IO::CollationStream::Write | ( | byte[] | buffer, |
int | offset, | ||
int | count | ||
) | [inline] |
Writes and compresses data to the collation buffer.
Periodically flushes the collation buffer and writes to the BaseStream.
buffer | The buffer to write data from. |
offset | Offset to the first byte to write. |
count | Number of bytes to write. |
This method should only be used to write data from a T:PacketBuffer.
override bool Tes::IO::CollationStream::CanRead [get] |
false
override bool Tes::IO::CollationStream::CanSeek [get] |
false
override bool Tes::IO::CollationStream::CanWrite [get] |
false
bool Tes::IO::CollationStream::CompressionEnabled [get, set] |
Toggle compression.
Initialised to true
.
While disabled, bytes are written directly to the BaseStream without collation or comrpession.
override long Tes::IO::CollationStream::Position [get, set] |
Get returns the number of bytes written plus the oustanding buffered bytes.
Set is not supported (exception).