PipeStream.Write Method (Byte[], Int32, Int32)
Writes a block of bytes to the current stream using data from a buffer.
Assembly: System.Core (in System.Core.dll)
[SecurityCriticalAttribute] public override void Write( byte[] buffer, int offset, int count )
Parameters
- buffer
-
Type:
System.Byte[]
The buffer that contains data to write to the pipe.
- offset
-
Type:
System.Int32
The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
- count
-
Type:
System.Int32
The maximum number of bytes to write to the current stream.
| Exception | Condition |
|---|---|
| ArgumentNullException | buffer is null. |
| ArgumentOutOfRangeException | offset is less than 0. -or- count is less than 0. |
| ArgumentException | count is greater than the number of bytes available in buffer. |
| ObjectDisposedException | The pipe is closed. |
| NotSupportedException | The pipe does not support write operations. |
| IOException | The pipe is broken or another I/O error occurred. |
Use the CanWrite property to determine whether the current PipeStream object supports write operations.
Calling the Write method blocks until count bytes are read or the end of the stream is reached. For asynchronous read operations, see BeginWrite and EndWrite.
Available since 3.5