Method ReadArrayElementBoundsChecked
ReadArrayElementBoundsChecked<T>(void*, int, int)
Reads an element from a buffer after bounds checking.
Declaration
public static T ReadArrayElementBoundsChecked<T>(void* source, int index, int capacity) where T : unmanaged
Parameters
| Type | Name | Description |
|---|---|---|
| void* | source | The buffer to read from. |
| int | index | The index of the element. |
| int | capacity | The buffer capacity (in number of elements). Used for the bounds checking. |
Returns
| Type | Description |
|---|---|
| T | The element read from the buffer. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of element. |
Exceptions
| Type | Condition |
|---|---|
| IndexOutOfRangeException | Thrown if the index is out of bounds. |