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

A stream implementation which uses a T:IO.CollatedPacketEncoder to compress data before writing to another stream. More...

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

Tes::IO::CollationStream::CollationStream ( Stream  baseStream,
bool  compress = true 
) [inline]

Createa a collation stream wrapping baseStream .

Parameters:
baseStreamThe stream to write into after collation.
compressEnable compression? Otherwise we collated without compression.

Member Function Documentation

override int Tes::IO::CollationStream::Read ( byte[]  buffer,
int  offset,
int  count 
) [inline]

Not suypported.

Returns:
N/A
Parameters:
bufferIgnored.
offsetIgnored.
countIgnored.
override long Tes::IO::CollationStream::Seek ( long  offset,
SeekOrigin  origin 
) [inline]

Not supported.

Returns:
N/A
Parameters:
offsetIgnored.
originIgnored.
override void Tes::IO::CollationStream::SetLength ( long  value) [inline]

Not supported.

Parameters:
valueIgnored.
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.

Parameters:
bufferThe buffer to write data from.
offsetOffset to the first byte to write.
countNumber of bytes to write.

This method should only be used to write data from a T:PacketBuffer.


Property Documentation

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).


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