// Bypass bounds checking – DANGEROUS ref T start = ref MemoryMarshal.GetArrayDataReference(array); return Unsafe.Add(ref start, index);
// Now buffer[0]=0x78, buffer[1]=0x56, buffer[2]=0x34, buffer[3]=0x12 (on little-endian) public static T GetAt<T>(T[] array, int index) System.runtime.compilerservices.unsafe Version 4.0.4.1
For application developers, this library remains an —you rarely need to call it directly. For library authors building performance-critical components, Unsafe is an indispensable tool, and version 4.0.4.1 remains a reliable choice for compatibility with .NET Standard 2.0 ecosystems. // Bypass bounds checking – DANGEROUS ref T