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

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

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

Definition at line 317 of file MemoryMarshal.cs.

317 : struct
318 {
319 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
320 {
321 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
322 }
323 if (Unsafe.SizeOf<T>() > (uint)span.Length)
324 {
325 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length);
326 }
327 return ref Unsafe.As<byte, T>(ref GetReference(span));
328 }

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