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

System.IO.Stream.ReadByte Method

Reads a byte from the stream and advances the position within the stream by one byte.

public virtual int ReadByte ()

Returns

The unsigned byte cast to a int , or -1 if at the end of the stream.

Exceptions

TypeReason
System.IO.IOExceptionAn I/O error has occurred.
NotSupportedExceptionThe stream does not support reading.
ObjectDisposedExceptionThe stream is closed.

Remarks

Operation
As described above.

Note: Use the Stream.CanRead property to determine whether the current instance supports reading.

Requirements

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