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. [Edit]

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

Parameters

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

Exceptions

TypeReason
ArgumentNullExceptionbuffer is null. [Edit]
ArgumentOutOfRangeException

offset < 0.

-or-

offset > buffer.Length.

-or-

size < 0.

-or-

size > buffer.Length - offset.

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

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

[Edit]

Requirements

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