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

定義

開始非同步的讀取作業。

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

參數

buffer
Byte[]

要讀入資料的位元組陣列。

offset
Int32

buffer 中的位元組位移,即開始從資料流讀取資料的位置。

count
Int32

要讀取的最大位元組數。

asyncCallback
AsyncCallback

選擇性的非同步回呼,在讀取作業完成時呼叫。

asyncState
Object

使用者所提供的物件,其可以從其他要求中區分出這個特定非同步讀取的要求。

傳回

物件,表示可能還在暫止中的非同步讀取作業。

例外狀況

buffernull

offset 小於零。

-或-

offsetcount 超出陣列的界限。

-或-

count 大於從 offsetbuffer 結尾的項目數。

適用於