NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Stream.BeginRead

Begins an asynchronous read.

[Visual Basic]
Overridable Public Function BeginRead( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal callback As AsyncCallback, _
   ByVal state As Object _
) As IAsyncResult
[C#]
public virtual IAsyncResult BeginRead(
   byte[] buffer,
   int offset,
   int count,
   AsyncCallback callback,
   object state
);
[C++]
public: virtual IAsyncResult* BeginRead(
   unsigned char* buffer[],
   int offset,
   int count,
   AsyncCallback* callback,
   Object* state
);
[JScript]
public function BeginRead(
   buffer : Byte[],
   offset : int,
   count : int,
   callback : AsyncCallback,
   state : Object
) : IAsyncResult;

Parameters

buffer
The buffer to read data from.
offset
The byte offset in buffer at which to begin reading.
count
The maximum number of bytes to read.
callback
An optional asynchronous callback, to be called when the read is complete.
state
The state object.

Return Value

An IAsyncResult that represents the asynchronous read, which is quite possibly still pending.

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 IO operation completes.

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

See Also

Stream Class | Stream Members | System.IO Namespace