- buffer
The buffer that contains the data to write to the current stream.
- offset
The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
- count
The maximum number of bytes to write.
- callback
The method to call when the asynchronous write operation is completed.
- state
A user-provided object that distinguishes this particular asynchronous write request from other requests.
![]()
An IAsyncResult object that references the asynchronous write operation.
PipeStream.EndWrite(IAsyncResult) must be called once for every call to PipeStream.BeginWrite(Byte[], int, int, AsyncCallback, object). This can be done either in the same code that called PipeStream.BeginWrite(Byte[], int, int, AsyncCallback, object) or in a callback that is passed to PipeStream.BeginWrite(Byte[], int, int, AsyncCallback, object).
Use the PipeStream.CanWrite property to determine whether the current System.IO.Pipes.PipeStream object supports write operations.
If the pipe is closed or an invalid argument is passed to PipeStream.BeginWrite(Byte[], int, int, AsyncCallback, object), the appropriate exceptions are raised immediately. Errors that occur during an asynchronous write request occur on the thread pool thread that is performing the request. The exceptions are raised when the code calls the PipeStream.EndWrite(IAsyncResult) method.