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

System.IO.FileStream.EndRead Method

Ends a pending asynchronous read request, and blocks until the read request has completed. [Edit]

public override int EndRead (IAsyncResult asyncResult)

Parameters

asyncResult
The IAsyncResult object for the pending asynchronous request. [Edit]

Returns

A int containing the number of bytes read from the stream. Returns 0 only if the end of the file has been reached, otherwise, this method blocks until at least one byte is available. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionasyncResult is null. [Edit]
ArgumentExceptionasyncResult was not returned by a call to FileStream.BeginRead(Byte[], int, int, AsyncCallback, object). [Edit]
InvalidOperationExceptionFileStream.EndRead(IAsyncResult) was called multiple times with asyncResult . [Edit]

Remarks

EndRead will block until the I/O operation has completed.

Note: This method overrides Stream.EndRead(IAsyncResult).

[Edit]

Requirements

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