通过


SqlFileStream.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[]

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

offset
Int32

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

count
Int32

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

返回

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

例外

对象不支持读取数据。

注解

使用 CanRead 属性确定当前实例是否支持写入。

适用于

另请参阅