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

定義

從指定的緩衝區位移開始,將來自指定資料行位移的位元組資料流讀取到緩衝區以做為陣列。

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 到 FieldCount 的範圍。

備註

GetBytes 會傳回欄位中可用位元組的數目。 通常這是欄位的確切長度。 不過,如果 GetBytes 已經用來從欄位元組取得位元組,則傳回的數位可能小於欄位的真長度。

如果您傳遞的緩衝區為 nullGetBytes 則會以位元組為單位傳回數據列的長度。

不會執行任何轉換;因此,擷取的數據必須是位元組陣列。

適用於