BeginRead Method
Collapse the table of content
Expand the table of content

IsolatedStorageFileStream.BeginRead Method

Begins an asynchronous read.

[Visual Basic]
Overrides Public Function BeginRead( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal numBytes As Integer, _
   ByVal userCallback As AsyncCallback, _
   ByVal stateObject As Object _
) As IAsyncResult
[C#]
public override IAsyncResult BeginRead(
 byte[] buffer,
 int offset,
 int numBytes,
 AsyncCallback userCallback,
 object stateObject
);
[C++]
public: IAsyncResult* BeginRead(
 unsigned char buffer __gc[],
 int offset,
 int numBytes,
 AsyncCallback* userCallback,
 Object* stateObject
);
[JScript]
public override function BeginRead(
   buffer : Byte[],
 offset : int,
 numBytes : int,
 userCallback : AsyncCallback,
 stateObject : Object
) : IAsyncResult;

Parameters

buffer
The buffer into which to read data.
offset
The byte offset in array at which to begin reading.
numBytes
The maximum number of bytes to read.
userCallback
The method to be called when the asynchronous read operation is completed. This parameter is optional.
stateObject
The status of the asynchronous read.

Return Value

An IAsyncResult that represents the asynchronous read, which is possibly still pending. This IAsyncResult must be passed to this stream's EndRead method to determine how many bytes were read. This can be done either by the same code that called BeginRead or in a callback passed to BeginRead.

Exceptions

Exception Type Condition
IOException An asynchronous read was attempted past the end of the file.

Remarks

The current position in the stream is updated when you issue the asynchronous read or write, not when the I/O operation completes.

You must call EndRead with this IAsyncResult to find out how many bytes were read.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IsolatedStorageFileStream Class | IsolatedStorageFileStream Members | System.IO.IsolatedStorage Namespace

Show:
© 2016 Microsoft