/// <summary> /// Ends an asynchronous write operation. /// </summary> /// <param name="asyncResult">A reference to the outstanding asynchronous I/O request.</param> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="asyncResult"/> is null. </exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="asyncResult"/> did not originate from a <see cref="M:System.IO.Stream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)"/> method on the current stream. </exception> /// <exception cref="T:System.IO.IOException">The stream is closed or an internal error has occurred.</exception> public override void EndWrite(IAsyncResult asyncResult) { if (_proxyAsyncRequests) { BaseStream.EndWrite(asyncResult); } else { base.EndWrite(asyncResult); } }
private void DoWrite(byte[] array, int offset, int count, bool isAsync) { Debug.Assert(array != null); Debug.Assert(count != 0); #if !NETFX_CORE if (isAsync) { var result = BaseStream.BeginWrite(array, offset, count, null, null); BaseStream.EndWrite(result); } else #endif { BaseStream.Write(array, offset, count); } }
/// <summary>异步写结束</summary> /// <param name="asyncResult"></param> public override void EndWrite(IAsyncResult asyncResult) { RaiseAction("EndWrite"); BaseStream.EndWrite(asyncResult); }
public override void EndWrite(IAsyncResult asyncResult) { BaseStream.EndWrite(asyncResult); }
/// <summary> /// Ends an asynchronous write operation. /// </summary> /// <param name="asyncResult">A reference to the outstanding asynchronous I/O request.</param> public override void EndWrite(IAsyncResult asyncResult) { CheckClosed(); BaseStream.EndWrite(asyncResult); }