Caution
You must ensure that index falls within Length, or at least in the bounds of the actual underlying array. Attempting to access protected memory may crash the runtime.
[SecurityCriticalAttribute]
public void SetElementUnsafe(
int index,
TTo value
)<SecurityCriticalAttribute>
Public Sub SetElementUnsafe (
index As Integer,
value As TTo
)public:
[SecurityCriticalAttribute]
void SetElementUnsafe(
int index,
TTo value
)[<SecurityCriticalAttribute>]
member SetElementUnsafe :
index : int *
value : 'TTo -> unit If the compiler you use supports members that return a value by reference, you can also use the GetElementReferenceUnsafe method.
| NotSupportedException | .NET Framework only: you execute this method in a partially trusted AppDomain that does not allow executing unverifiable code. |
| NullReferenceException | The IsNull property returns . |
| DataMisalignedException | TTo is a primitive type of size larger than 1 byte, the address of the element at the specified index is not properly aligned, and the executing architecture does not support misaligned memory access (e.g. ARM). |