IDataRecord.GetBytes(Int32, Int64, Byte[], Int32, Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从指定的列偏移量读取缓冲区中的字节流作为数组,从给定的缓冲区偏移量开始。
public:
long GetBytes(int i, long fieldOffset, cli::array <System::Byte> ^ buffer, int bufferoffset, int length);
public long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length);
public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length);
abstract member GetBytes : int * int64 * byte[] * int * int -> int64
Public Function GetBytes (i As Integer, fieldOffset As Long, buffer As Byte(), bufferoffset As Integer, length As Integer) As Long
参数
- i
- Int32
从零开始的列序号。
- fieldOffset
- Int64
从中启动读取操作的字段中的索引。
- buffer
- Byte[]
要在其中读取字节流的缓冲区。
- bufferoffset
- Int32
用于启动读取操作的索引 buffer 。
- length
- Int32
要读取的字节数。
返回
读取的实际字节数。
例外
传递的索引超出了 0 到 FieldCount0 的范围。
注解
GetBytes 返回字段中的可用字节数。 通常,这是字段的确切长度。 但是,如果 GetBytes 已用于从字段中获取字节,则返回的数字可能小于字段的真实长度。
如果传递缓冲区,nullGetBytes则返回行的长度(以字节为单位)。
不执行任何转换;因此,检索的数据必须是字节数组。