GZipStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) メソッド

定義

非同期書き込み操作を開始します。 (代わりに WriteAsync(Byte[], Int32, Int32) メソッドを使用することを検討してください。

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

パラメーター

arraybuffer
Byte[]

現在のストリームに書き込むデータを格納しているバッファー。

offset
Int32

書き込みを開始するバイト オフセット。

count
Int32

書き込む最大バイト数。

asyncCallback
AsyncCallback

書き込み操作が完了したときに呼び出される省略可能な非同期コールバック。

asyncState
Object

この特定の非同期書き込み要求を他の要求と区別するユーザー指定のオブジェクト。

返品

非同期書き込み操作を表すオブジェクト。まだ保留中である可能性があります。

例外

基になるストリームは null

-又は-

基になるストリームが閉じられます。

注釈

.NET Framework 4.5 以降では、 Stream.WriteAsync メソッドを使用して非同期書き込み操作を実行できます。 BeginWrite メソッドは、レガシ コードをサポートするために現在のバージョンでも使用できますが、新しい非同期メソッドを使用すると、非同期 I/O 操作をより簡単に実装できます。 詳細については、「 非同期ファイル I/O」を参照してください。

BeginWrite メソッドは、GZipStream ストリーム オブジェクトへの非同期書き込み操作を開始します。

AsyncCallback デリゲートを実装し、その名前を BeginWrite メソッドに渡すコールバック メソッドを作成する必要があります。

適用対象