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

定義

非同期の書き込み操作を開始します。 (代わりに、WriteAsync(Byte[], Int32, Int32) メソッドの使用を検討します)。

public:
 override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int count, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public:
 override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ buffer, int offset, int count, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public override IAsyncResult BeginWrite (byte[] array, int offset, int count, AsyncCallback? asyncCallback, 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);
override this.BeginWrite : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
override this.BeginWrite : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
Public Overrides Function BeginWrite (array As Byte(), offset As Integer, count As Integer, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult
Public Overrides Function BeginWrite (buffer 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 必要があります。

適用対象