MemoryMappedViewStream: BeginWrite

BeginWrite

Begins an asynchronous write operation. (Consider using WriteAsync instead; see the Remarks section.)



 Public Function BeginWrite(
	  Buffer ( ) As Byte,
	  ByVal Offset As Long,
	  ByVal Count As Long,
	  Optional ByVal Callback As AsyncCallback,
	  Optional State As Variant ) As IAsyncResult

Parameters

Buffer
[ByRef] Byte. The buffer to write data from.
Offset
[ByVal] Long. The byte offset in Buffer from which to begin writing.
Count
[ByVal] Long. The maximum number of bytes to write.
Callback
[ByVal] Optional. AsyncCallback. An optional asynchronous callback, to be called when the write is complete.
State
[ByRef] Optional. Variant. A user-provided object that distinguishes this particular asynchronous write request from other requests.

Return Values

IAsyncResult -  An IAsyncResult that represents the asynchronous write, which could still be pending.

Remarks

The default implementation of BeginWrite on a stream calls the Write method synchronously.

Exceptions

Exception Condition
ArgumentExceptionAttempted an asynchronous write past the end of the stream, or a disk error occurs.
ObjectDisposedExceptionMethods were called after the stream was closed.
NotSupportedExceptionThe current Stream implementation does not support the write operation.

See Also

Project CorLib Overview

Class MemoryMappedViewStream Overview