Export (0) Print
Expand All

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)

abstract Write : 
        buffer:byte[] * 
        offset:int * 
        count:int -> unit  
override Write : 
        buffer:byte[] * 
        offset:int * 
        count:int -> unit

Parameters

buffer
Type: System.Byte[]

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

offset
Type: System.Int32

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

count
Type: System.Int32

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

ExceptionCondition
ArgumentNullException

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

ArgumentException

offset < 0.

-or-

offset > the length of buffer.

-or-

offset + count > the length of buffer.

IOException

The write operation failed.

NotSupportedException

There is already a write operation in progress.

ObjectDisposedException

This object has been closed.

InvalidOperationException

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft