OracleDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從指定的欄位偏移量讀取一串位元組到緩衝區,從指定的緩衝區偏移開始,作為陣列。
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 回傳欄位的長度(以位元組為單位)。