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

System.IO.FileStream.ReadByte Method

Reads a byte from the file and advances the read position one byte.

public override int ReadByte ()

Returns

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

Exceptions

TypeReason
ObjectDisposedExceptionThe current stream is closed.
NotSupportedExceptionThe current stream does not support reading.

Remarks

Note:

Use the FileStream.CanRead property to determine whether the current instance supports reading. For additional information, see Stream.CanRead.

This method overrides Stream.ReadByte.

Requirements

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