Summary
Implements a stream which enables control codes to be read from or written to the underlying stream at
certain points. This stream handles encoding and decoding the control codes and ensuring they are distinguishable
from the payload data. See Remarks.
Remarks
This stream does not support seeking because of the variable length nature of the data between control points.
Seeking directly on the underlying stream must be avoided, since seeking into the middle of an escape sequence
will result in incorrect data being read.
Constructors
Instance methods
void | | Flushes the underlying stream. |
int | Read(byte[] buffer, int offset, int count) |
Reads up to count bytes into the buffer from the underlying stream. If a control code
is encountered before any data has been read, will throw an InvalidOperationException. If some
data has already been read upon encountering a control code, will stop and return all the data read up to the control code.
|
int | |
Reads a control code from the stream at the current position. If there is no control code at the current position,
returns -1 . Otherwise returns the code read. Throws EndOfStreamException if the stream ends in
the middle of a control code.
|
long | Seek(long offset, SeekOrigin origin) | Throws a NotSupportedException. |
void | |
void | Write(byte[] buffer, int offset, int count) | Writes the specified data to the underlying stream. |
void | | Writes the specified control code to the stream. |
Instance properties
bool | | Indicates whether the underlying stream, and hence this stream, supports reading. |
bool | | Always returns false. |
bool | | Indicates whether the underlying stream, and hence this stream, supports writing. |
bool | |
Determines if the stream has ended. Note that this method may block, potentially indefinitely, in cases where
it isn't known yet if the stream has ended (for example, a NetworkStream for a socket that is idle but not closed).
|
long | | Throws a NotSupportedException. |
long | |