SqlBytes.Read(Int64, Byte[], Int32, Int32) 方法

定義

從此 SqlBytes 實例複製位元組到傳入緩衝區,並回傳複製的位元組數量。

public:
 long Read(long offset, cli::array <System::Byte> ^ buffer, int offsetInBuffer, int count);
public long Read(long offset, byte[] buffer, int offsetInBuffer, int count);
member this.Read : int64 * byte[] * int * int -> int64
Public Function Read (offset As Long, buffer As Byte(), offsetInBuffer As Integer, count As Integer) As Long

參數

offset
Int64

一個 Int64 多數值偏移到實例中包含的 SqlBytes 值。

buffer
Byte[]

要複製到的位元組陣列緩衝區。

offsetInBuffer
Int32

一個 Int32 整數偏移到緩衝區開始複製。

count
Int32

一個 Int32 整數代表要複製的位元組數。

傳回

一個 Int64 長值代表複製的位元組數。

備註

若嘗試讀取超過 MaxLength,則會拋出例外。

如果 count 指定要複製的位元組數超過從 offset 值到末尾可用的位元組,則只複製可用的位元組。

如果目的緩衝區是空參考,則會拋出例外。

若目的緩衝區無法接收到請求的字元數量,則會拋出例外。

適用於

另請參閱