语言

WebSocketStream.Read(Byte[], Int32, Int32) 方法

定义

在派生类中重写时,从当前流中读取字节序列,并通过读取的字节数推进流中的位置。

public:
 override int Read(cli::array <System::Byte> ^ buffer, int offset, int count);
public override int Read(byte[] buffer, int offset, int count);
override this.Read : byte[] * int * int -> int
Public Overrides Function Read (buffer As Byte(), offset As Integer, count As Integer) As Integer

参数

buffer
Byte[]

字节数组。 此方法返回时,缓冲区包含指定的字节数组,其值介于和 (offsetoffset + - 1) 之间count,用从当前源读取的字节替换。

offset
Int32

从零开始的字节偏移量 buffer ,从中开始存储从当前流中读取的数据。

count
Int32

要从当前流中读取的最大字节数。

返回

读取到缓冲区中的字节总数。 如果当前没有可用字节数,则此字节数可能小于请求的字节数;如果 count 已达到 0 或流的末尾,则为零(0)。

适用于