Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere .NET 2.0 API Reference » SADataReader class

GetByte method Next Page

GetBytes method

Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.


Visual Basic

Public Overrides Function GetBytes( _
ByVal ordinal As Integer, _
ByVal dataIndex As Long, _
ByVal buffer As Byte(), _
ByVal bufferIndex As Integer, _
ByVal length As Integer _
) As Long


public override long GetBytes(
int ordinal,
long dataIndex,
byte[] buffer,
int bufferIndex,
int length

Return value

The number of bytes read.


GetBytes returns the number of available bytes in the field. In most cases this is the exact length of the field. However, the number returned may be less than the true length of the field if GetBytes has already been used to obtain bytes from the field. This may be the case, for example, when the SADataReader is reading a large data structure into a buffer.

If you pass a buffer that is a null reference (Nothing in Visual Basic), GetBytes returns the length of the field in bytes.

No conversions are performed, so the data retrieved must already be a byte array.

See also