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.

适用于