MemoryStream: BeginRead |
Begins an asynchronous buffer read. For a MemoryStream, calling an asynchronous buffer read is identical to calling ReadBlock.
Public Function BeginRead( ByRef Buffer ( ) As Byte, ByVal Offset As Long, ByVal Count As Long, Optional ByVal Callback As AsyncCallback, Optional ByRef State As Variant ) As IAsyncResult
Since the stream is directly stored and accessed in memory, there is no waiting for reads to occur. The BeginRead method works identical to the ReadBlock method in terms of immediately reading stream data into the Buffer.
When defining the Count for the number of maximum bytes to be read, if the stream does not have enough bytes, the read will copy less bytes than Count.
If an exception has occurred during the read, it will not be thrown until the EndRead is executed.