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.BeginWrite

Begins an asynchronous write.

[Visual Basic]
Overridable Public Function BeginWrite( _
   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 BeginWrite(
   byte[] buffer,
   int offset,
   int count,
   AsyncCallback callback,
   object state
);
[C++]
public: virtual IAsyncResult* BeginWrite(
   unsigned char* buffer[],
   int offset,
   int count,
   AsyncCallback* callback,
   Object* state
);
[JScript]
public function BeginWrite(
   buffer : Byte[],
   offset : int,
   count : int,
   callback : AsyncCallback,
   state : Object
) : IAsyncResult;

Parameters

buffer
The buffer to write data to.
offset
The byte offset in buffer at which to begin writing.
count
The maximum number of bytes to write.
callback
An optional asynchronous callback, to be called when the write 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 write 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 EndWrite with this IAsyncResult to find out how many bytes were written.

See Also

Stream Class | Stream Members | System.IO Namespace