Share via


AdoDotNetReader.GetBytes Method (Int32, array<Byte , Int32, Int32)

Retrieves a specified number of bytes of binary data.

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

Syntax

'Declaration
Public Overrides Function GetBytes ( _
    index As Integer, _
    buffer As Byte(), _
    bufferIndex As Integer, _
    length As Integer _
) As Integer
public override int GetBytes(
    int index,
    byte[] buffer,
    int bufferIndex,
    int length
)
public:
virtual int GetBytes(
    int index, 
    array<unsigned char>^ buffer, 
    int bufferIndex, 
    int length
) override
abstract GetBytes : 
        index:int * 
        buffer:byte[] * 
        bufferIndex:int * 
        length:int -> int  
override GetBytes : 
        index:int * 
        buffer:byte[] * 
        bufferIndex:int * 
        length:int -> int
public override function GetBytes(
    index : int, 
    buffer : byte[], 
    bufferIndex : int, 
    length : int
) : int

Parameters

  • index
    Type: System.Int32

    Index in the current block of data for the item to retrieve.

  • buffer
    Type: array<System.Byte[]

    An array into which specified data, as 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

    Index of the starting point in the byte array specified by the buffer parameter.

  • length
    Type: System.Int32

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

Return Value

Type: System.Int32
A numerical value indicating the number of bytes read into the buffer.

Implements

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

Remarks

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

.NET Framework Security

See Also

Reference

AdoDotNetReader Class

GetBytes Overload

Microsoft.VisualStudio.Data.Framework.AdoDotNet Namespace