语言

OracleDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32) 方法

定义

从指定的列偏移量读取缓冲区中的字节流作为数组,从给定的缓冲区偏移量开始。

public:
 virtual long GetBytes(int i, long fieldOffset, cli::array <System::Byte> ^ buffer2, int bufferoffset, int length);
public:
 override long GetBytes(int i, long fieldOffset, cli::array <System::Byte> ^ buffer2, int bufferoffset, int length);
public long GetBytes(int i, long fieldOffset, byte[] buffer2, int bufferoffset, int length);
public override long GetBytes(int i, long fieldOffset, byte[] buffer2, int bufferoffset, int length);
abstract member GetBytes : int * int64 * byte[] * int * int -> int64
override this.GetBytes : int * int64 * byte[] * int * int -> int64
override this.GetBytes : int * int64 * byte[] * int * int -> int64
Public Function GetBytes (i As Integer, fieldOffset As Long, buffer2 As Byte(), bufferoffset As Integer, length As Integer) As Long
Public Overrides Function GetBytes (i As Integer, fieldOffset As Long, buffer2 As Byte(), bufferoffset As Integer, length As Integer) As Long

参数

i
Int32

从零开始的列序号。

fieldOffset
Int64

读取操作开始的字段中的索引。

buffer2
Byte[]

要在其中读取字节流的缓冲区。

bufferoffset
Int32

要开始写入操作的 buffer2 索引。

length
Int32

要读取的字节数。

返回

读取的实际字节数。

实现

注解

GetBytes 返回字段中的可用字节数。 在大多数情况下,这是字段的确切长度。 但是,如果 GetBytes 已用于从字段中获取字节,则返回的数字可能小于字段的真实长度。 例如,如果 OracleDataReader 正在将大型数据结构读取到缓冲区中,则可能是这种情况。 有关详细信息,请参阅 SequentialAccess 设置 CommandBehavior。

如果传递的缓冲区为 null 值,则 GetBytes 返回字段的长度(以字节为单位)。

适用于