Export (0) Print
Expand All

PipeStream.Write Method

Writes a block of bytes to the current stream using data from a buffer.

Namespace:  System.IO.Pipes
Assembly:  System.Core (in System.Core.dll)

public override void Write(
	byte[] buffer,
	int offset,
	int count


Type: System.Byte[]

The buffer that contains data to write to the pipe.

Type: System.Int32

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

Type: System.Int32

The maximum number of bytes to write to the current stream.


buffer is null.


offset is less than 0.


count is less than 0.


count is greater than the number of bytes available in buffer.


The pipe is closed.


The pipe does not support write operations.


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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft