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
)

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.

ExceptionCondition
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.

.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.

Show:
© 2014 Microsoft