Mono Class Library: System.Net.Sockets.NetworkStream Overview | Members

System.Net.Sockets.NetworkStream.Write Method

Writes data from a specific area of a data buffer to the current instance.

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

Parameters

buffer
A byte array containing data to write to the stream.
offset
A int containing the zero-based position in buffer containing the starting location of the data to write.
size
A int containing the number of bytes to write to the stream.

Exceptions

TypeReason
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeException

offset < 0.

-or-

offset > buffer.Length.

-or-

size < 0.

-or-

size > buffer.Length - offset.

System.IO.IOException
Note: This method catches all exceptions thrown by the Socket.Send(Byte[], int, SocketFlags) method.
ObjectDisposedExceptionThe current instance has been disposed.

Remarks

When no buffer space is available within the underlying protocol, this method blocks unless the socket is in non-blocking mode.

Note:

This method overrides System.IO.Stream.Write(Byte[], int, int).

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0