SslStream.Write Method (Byte[], Int32, Int32)

Write the specified number of Bytes to the underlying stream using the specified buffer and offset.

Namespace: System.Net.Security
Assembly: System (in system.dll)

public override void Write (
	byte[] buffer,
	int offset,
	int count
public void Write (
	byte[] buffer, 
	int offset, 
	int count
public override function Write (
	buffer : byte[], 
	offset : int, 
	count : int
Not applicable.



A Byte array that supplies the bytes written to the stream.


A Int32 that contains the zero-based location in buffer at which to begin reading bytes to be written to the stream.


A Int32 that contains the number of bytes to read from buffer.

Exception typeCondition


buffer is a null reference (Nothing in Visual Basic).


offset < 0.


offset > the length of buffer.


offset + count > the length of buffer.


The write operation failed.


There is already a write operation in progress.


This object has been closed.


Authentication has not occurred.

This method blocks while the operation completes. To prevent blocking while the operation completes the operation completes, use the BeginWrite method.

You cannot call this method until you have successfully authenticated. To authenticate call one of the AuthenticateAsClient, or BeginAuthenticateAsClient, AuthenticateAsServer, BeginAuthenticateAsServer methods.

The SslStream class does not support multiple simultaneous write operations.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0