OleDbDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32) Metodo

Definizione

Legge un flusso di byte dalla colonna specificata nel buffer come una matrice a partire dall'offset del buffer determinato.

public:
 override long GetBytes(int ordinal, long dataIndex, cli::array <System::Byte> ^ buffer, int bufferIndex, int length);
public:
 virtual long GetBytes(int ordinal, long dataIndex, cli::array <System::Byte> ^ buffer, int bufferIndex, int length);
public override long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length);
public override long GetBytes (int ordinal, long dataIndex, byte[]? buffer, int bufferIndex, int length);
public long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length);
override this.GetBytes : int * int64 * byte[] * int * int -> int64
abstract member GetBytes : int * int64 * byte[] * int * int -> int64
override this.GetBytes : int * int64 * byte[] * int * int -> int64
Public Overrides Function GetBytes (ordinal As Integer, dataIndex As Long, buffer As Byte(), bufferIndex As Integer, length As Integer) As Long
Public Function GetBytes (ordinal As Integer, dataIndex As Long, buffer As Byte(), bufferIndex As Integer, length As Integer) As Long

Parametri

ordinal
Int32

Ordinale di colonna in base zero.

dataIndex
Int64

Indice all'interno del campo da cui avviare l'operazione di lettura.

buffer
Byte[]

Buffer in cui leggere il flusso di byte.

bufferIndex
Int32

Indice all'interno del parametro buffer dal quale iniziare l'operazione di scrittura.

length
Int32

Lunghezza massima per la copia nel buffer.

Restituisce

Numero effettivo di byte letti.

Implementazioni

Commenti

GetBytes restituisce il numero di byte disponibili nel campo. La maggior parte del tempo è la lunghezza esatta del campo. Tuttavia, il numero restituito può essere minore della lunghezza effettiva del campo se GetBytes è già stato usato per ottenere byte dal campo. Questo può essere il caso, ad esempio, quando si OleDbDataReader legge una struttura di dati di grandi dimensioni in un buffer. Per altre informazioni, vedere l'impostazione SequentialAccess per CommandBehavior.

Se si passa un buffer che è null, GetBytes restituisce la lunghezza del campo in byte.

Non vengono eseguite conversioni; pertanto, i dati recuperati devono essere già una matrice di byte.

Si applica a

Vedi anche