Mono Class Library: System.IO.MemoryStream Overview | Members

System.IO.MemoryStream.ReadByte Method

Reads a byte from the current stream at the current position. [Edit]

public override int ReadByte ()

Returns

The byte cast to a int, or -1 if the end of the stream has been reached. [Edit]

Exceptions

TypeReason
ObjectDisposedException The current stream is closed. [Edit]

Remarks

If the read operation is successful, the current position within the stream is advanced by one byte. If an exception occurs, the current position within the stream is unchanged.

If the read takes place immediately following a seek beyond the end of the stream, the end of the stream is reached.

Note: This method overrides Stream.ReadByte.

[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0