Compartir a través de


DataReader.GetBytes Method (String, array<Byte , Int32, Int32)

Retrieves a specified number of bytes of raw binary data.

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
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

Parameters

  • name
    Type: System.String

    The name of the item for which to retrieve raw binary data.

  • buffer
    Type: array<System.Byte[]

    An array into which specified data, as a byte array, should be placed. If nulla null reference (Nothing in Visual Basic), this method returns the size required of the array in order to fit all of the specified data.

  • bufferIndex
    Type: System.Int32

    The index of the starting point in the byte array specified in the buffer parameter.

  • length
    Type: System.Int32

    The number of bytes to be read into the byte array specified in the buffer parameter.

Return Value

Type: System.Int32
An integer value indicating the number of bytes read into the buffer.

Implements

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

Remarks

When data is presented by the DDEX provider in the form of raw bytes, call this method to read only a specified number of bytes into an existing client-side buffer. This provides better performance than simply retrieving the whole value, which causes all the data to be read and allocated in memory.

This method calls GetItemIndex to get the index corresponding to the item name and then passes this index to GetBytes to retrieve the requested number of bytes of raw binary data.

.NET Framework Security

See Also

Reference

DataReader Class

GetBytes Overload

Microsoft.VisualStudio.Data.Framework Namespace

GetBytes