共用方式為


DataReader.GetBytes 方法 (String, array<Byte , Int32, Int32)

擷取所指定的位元組數未經處理的二進位資料。

命名空間:  Microsoft.VisualStudio.Data.Framework
組件:  Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)

語法

'宣告
Public Overridable Function GetBytes ( _
    name As String, _
    buffer As Byte(), _
    bufferIndex As Integer, _
    length As Integer _
) As Integer
public virtual int GetBytes(
    string name,
    byte[] buffer,
    int bufferIndex,
    int length
)
public:
virtual int GetBytes(
    String^ name, 
    array<unsigned char>^ buffer, 
    int bufferIndex, 
    int length
)
abstract GetBytes : 
        name:string * 
        buffer:byte[] * 
        bufferIndex:int * 
        length:int -> int 
override GetBytes : 
        name:string * 
        buffer:byte[] * 
        bufferIndex:int * 
        length:int -> int 
public function GetBytes(
    name : String, 
    buffer : byte[], 
    bufferIndex : int, 
    length : int
) : int

參數

  • name
    型別:System.String
    項目名稱可以擷取未經處理的二進位資料。
  • buffer
    型別:array<System.Byte[]
    指定資料,做為位元組陣列應該放置的陣列。如果 nullNull 參照 (即 Visual Basic 中的 Nothing),這個方法會傳回要求的大小陣列以便將所有指定的資料。
  • bufferIndex
    型別:System.Int32
    開頭的索引 buffer 參數所指定的位元組陣列。
  • length
    型別:System.Int32
    要讀取的位元組數至 buffer 參數所指定的位元組陣列。

傳回值

型別:System.Int32
表示位元組數目的整數值讀入緩衝區。

實作

IVsDataReader.GetBytes(String, array<Byte[], Int32, Int32)

備註

以未經處理的位元組陣列的形式時, DDEX 提供者提供資料,請呼叫這個方法為唯讀指定位元組數至現有的用戶端緩衝區。這會擷取整個值提供更好的效能,在記憶體中所讀取的所有資料和配置。

呼叫這個方法 GetItemIndex 取得索引與項目名稱對應會傳遞這個索引。 GetBytes 擷取要求的位元組數未經處理的二進位資料。

.NET Framework 安全性

請參閱

參考

DataReader 類別

GetBytes 多載

Microsoft.VisualStudio.Data.Framework 命名空間

GetBytes