System.Net.Security.SslStream.Read Method

Reads data from this stream and stores it in the specified array.

Syntax

public override int Read (byte[] buffer, int offset, int count)

Parameters

buffer
A byte array that receives the bytes read from this stream.
offset
A int that contains the zero-based location in buffer at which to begin storing the data read from this stream.
count
A int that contains the maximum number of bytes to read from this stream.

Returns

A int value that specifies the number of bytes read. When there is no more data to be read, returns 0.

Remarks

The method reads a maximum of count bytes from the stream and stores them in buffer beginning at offset. You cannot perform multiple simultaneous read operations.

You cannot call this method until you have successfully authenticated. To authenticate call one of the erload:System.Net.Security.SslStream.AuthenticateAsClient, or erload:System.Net.Security.SslStream.BeginAuthenticateAsClient, erload:System.Net.Security.SslStream.AuthenticateAsServer, erload:System.Net.Security.SslStream.BeginAuthenticateAsServer methods.

To perform this operation asynchronously, use the SslStream.BeginRead(Byte[], int, int, AsyncCallback, object) method.

Requirements

Namespace: System.Net.Security
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0