ZLibStream.BeginRead(Byte[], Int32, Int32, AsyncCallback, Object) Method

Definition

Begins an asynchronous read operation.

public:
 override IAsyncResult ^ BeginRead(cli::array <System::Byte> ^ buffer, int offset, int count, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState);
override this.BeginRead : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
Public Overrides Function BeginRead (buffer As Byte(), offset As Integer, count As Integer, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Parameters

buffer
Byte[]

The byte array to read the data into.

offset
Int32

The byte offset in buffer at which to begin reading data from the stream.

count
Int32

The maximum number of bytes to read.

asyncCallback
AsyncCallback

An optional asynchronous callback, to be called when the read operation is complete.

asyncState
Object

A user-provided object that distinguishes this particular asynchronous read request from other requests.

Returns

An object that represents the asynchronous read operation, which could still be pending.

Exceptions

buffer is null.

offset is less than zero.

-or-

offset and count were out of bounds for the array.

-or-

count is greater than the number of elements from offset to the end of buffer.

Applies to