FileStream.BeginRead Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Begins an asynchronous read.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Overrides Function BeginRead ( _ array As Byte(), _ offset As Integer, _ numBytes As Integer, _ userCallback As AsyncCallback, _ stateObject As Object _ ) As IAsyncResult
Parameters
- array
- Type:
System.Byte
()
The buffer to read data into.
- offset
- Type: System.Int32
The byte offset in array at which to begin reading.
- numBytes
- Type: System.Int32
The maximum number of bytes to read.
- userCallback
- Type: System.AsyncCallback
The method to be called when the asynchronous read operation is completed.
- stateObject
- Type: System.Object
A user-provided object that distinguishes this particular asynchronous read request from other requests.
| Exception | Condition |
|---|---|
| ArgumentException | The array length minus offset is less than numBytes. |
| ArgumentNullException | array is Nothing. |
| ArgumentOutOfRangeException | offset or numBytes is negative. |
| IOException | An asynchronous read was attempted past the end of the file. |
Show: