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

定義

非同期の書き込み操作を開始します。

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

パラメーター

buffer
Byte[]

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

offset
Int32

現在のストリームへのバイトのコピーを開始する位置を示す buffer 内のバイト オフセット。インデックス番号は 0 から始まります。

count
Int32

書き込む最大バイト数。

callback
AsyncCallback

非同期の書き込み操作が完了したときに呼び出すメソッド。

state
Object

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

戻り値

非同期の書き込み操作を参照する IAsyncResult オブジェクト。

属性

例外

buffernullです。

offset が 0 未満です。

または

count が 0 未満です。

countbuffer で使用可能なバイト数を超えています。

パイプは閉じています。

パイプが書き込み操作をサポートしていません。

パイプが接続解除されたか、パイプが接続を待機しているか、またはハンドルが設定されていません。

パイプが接続解除されているか、別の I/O エラーが発生しました。

注釈

EndWrite の呼び出しごとに 1 回呼び出す BeginWrite必要があります。 これは、 を呼び出 BeginWrite したのと同じコードで、または に BeginWrite渡されるコールバックで実行できます。

現在PipeStreamのオブジェクトがCanWrite書き込み操作をサポートしているかどうかを判断するには、 プロパティを使用します。

パイプが閉じているか、無効な引数が に BeginWrite渡された場合、適切な例外が直ちに発生します。 非同期書き込み要求中に発生するエラーは、要求を実行しているスレッド プール スレッドで発生します。 例外は、コードが メソッドを呼び出すときに発生します EndWrite

適用対象