MemoryStream.EndWrite(IAsyncResult) 方法

定義

結束非同步的寫入作業。Ends an asynchronous write operation. (請考慮用 WriteAsync(Byte[], Int32, Int32, CancellationToken) 替代。)(Consider using WriteAsync(Byte[], Int32, Int32, CancellationToken) instead.)

public:
 override void EndWrite(IAsyncResult ^ asyncResult);
public override void EndWrite (IAsyncResult asyncResult);
override this.EndWrite : IAsyncResult -> unit
Public Overrides Sub EndWrite (asyncResult As IAsyncResult)

參數

asyncResult
IAsyncResult

未處理的非同步 I/O 要求的參考。A reference to the outstanding asynchronous I/O request.

例外狀況

asyncResultnullasyncResult is null.

暫止寫入作業的控制代碼無法使用。A handle to the pending write operation is not available.

-或--or-

暫止的作業不支援寫入。The pending operation does not support writing.

asyncResult 不是來自目前資料流的 BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) 方法。asyncResult did not originate from a BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) method on the current stream.

資料流已關閉或發生內部錯誤。The stream is closed or an internal error has occurred.

備註

如需此方法的其他使用方式資訊,請參閱 EndWrite 備註。Refer to the EndWrite remarks for additional usage information for this method.

適用於