/// <summary> /// Retrieves a column as an array of bytes (blob) /// </summary> /// <param name="i">The index of the column to retrieve</param> /// <param name="fieldOffset">The zero-based index of where to begin reading the data</param> /// <param name="buffer">The buffer to write the bytes into</param> /// <param name="bufferoffset">The zero-based index of where to begin writing into the array</param> /// <param name="length">The number of bytes to retrieve</param> /// <returns>The actual number of bytes written into the array</returns> /// <remarks> /// To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. /// </remarks> public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { if (i >= VisibleFieldCount && _keyInfo != null) { return(_keyInfo.GetBytes(i - VisibleFieldCount, fieldOffset, buffer, bufferoffset, length)); } VerifyType(i, DbType.Binary); return(_activeStatement._sql.GetBytes(_activeStatement, i, (int)fieldOffset, buffer, bufferoffset, length)); }