Compartir a través de


DataReader.GetBytes (Método)

Recupera un número de bytes especificado de datos binarios sin formato.

Espacio de nombres:  Microsoft.VisualStudio.Data
Ensamblado:  Microsoft.VisualStudio.Data (en Microsoft.VisualStudio.Data.dll)

Sintaxis

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

Parámetros

  • index
    Tipo: System.Int32
    Índice en el bloque actual de datos para que el elemento recupere.
  • buffer
    Tipo: array<System.Byte[]
    Una matriz donde especificó datos, como una matriz de bytes, debe estar.Si nullreferencia null (Nothing en Visual Basic), este método devuelve el tamaño necesario de matriz para ajustarse todos los datos especificados.
  • bufferIndex
    Tipo: System.Int32
    Índice de punto inicial de la matriz de bytes especificada mediante el parámetro de buffer .
  • length
    Tipo: System.Int32
    El número de bytes que se va a leer en la matriz de bytes especificada mediante el parámetro de buffer .

Valor devuelto

Tipo: System.Int32
Devuelve un valor entero que indica el número de bytes leídos en el búfer.

Excepciones

Excepción Condición
ArgumentOutOfRangeException

index, bufferIndex, o los parámetros de length no son válidos.

Comentarios

Cuando los datos se muestra mediante el proveedor de DDEX en forma de bytes sin formato, llame a este método en readonly el número de bytes especificado en un búfer de cliente existente.Esto funciona mejor que simplemente recupera el valor del conjunto, que hace que todos los datos que se va a leer y asignados en memoria.

Seguridad de .NET Framework

Vea también

Referencia

DataReader Clase

Microsoft.VisualStudio.Data (Espacio de nombres)