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 TTo GetElementUnsafe(
int index
)<SecurityCriticalAttribute>
Public Function GetElementUnsafe (
index As Integer
) As TTopublic:
[SecurityCriticalAttribute]
TTo GetElementUnsafe(
int index
)[<SecurityCriticalAttribute>]
member GetElementUnsafe :
index : int -> 'TTo 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 result is not properly aligned at the specified index, and the executing architecture does not support misaligned memory access (e.g. ARM). |