Share via


Write Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Writes data to the NetworkStream.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)

Syntax

'Declaration
Public Overrides Sub Write ( _
    buffer As Byte(), _
    offset As Integer, _
    count As Integer _
)
public override void Write(
    byte[] buffer,
    int offset,
    int count
)
public:
virtual void Write(
    array<unsigned char>^ buffer, 
    int offset, 
    int count
) override
abstract Write : 
        buffer:byte[] * 
        offset:int * 
        count:int -> unit 
override Write : 
        buffer:byte[] * 
        offset:int * 
        count:int -> unit 
public override function Write(
    buffer : byte[], 
    offset : int, 
    count : int
)

Parameters

Remarks

The Write method starts at the specified offset and sends count bytes from the contents of buffer to the network. The Write method blocks until the requested number of bytes is sent or a SocketException is thrown. If you receive a SocketException, use the SocketException..::..ErrorCode property to obtain the specific error code, and refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error.

.NET Framework Security

See Also

Reference

NetworkStream Class

System.Net.Sockets Namespace