GetBytes Method

DataReader.GetBytes Method

Retrieves a specified number of bytes of raw binary data.

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

public abstract int GetBytes(
	int index,
	byte[] buffer,
	int bufferIndex,
	int length


Type: System.Int32
Index into the current block of data for the item to retrieve.
Type: System.Byte[]
An array into which specified data, as byte array, should be placed. If null, this method returns the size required of the array in order to fit all of the specified data.
Type: System.Int32
Index of starting point in the byte array specified with the buffer parameter.
Type: System.Int32
The number of bytes to be read into the byte array specified with the buffer parameter.

Return Value

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


The index, bufferIndex, and/or length parameters are invalid.

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 performs better than simply retrieving the whole value, which causes all the data to be read and allocated in memory.

Community Additions

© 2016 Microsoft