Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AsRef< T >() [2/2]

static ref T System.Runtime.InteropServices.MemoryMarshal.AsRef< T > ( Span< byte > span)
inlinestatic
Type Constraints
T :struct 

Definition at line 303 of file MemoryMarshal.cs.

303 : struct
304 {
305 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
306 {
307 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
308 }
309 if (Unsafe.SizeOf<T>() > (uint)span.Length)
310 {
311 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length);
312 }
313 return ref Unsafe.As<byte, T>(ref GetReference(span));
314 }

References System.ThrowHelper.ThrowArgumentOutOfRangeException(), and System.ThrowHelper.ThrowInvalidTypeWithPointersNotSupported().