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

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

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

Definition at line 27 of file MemoryMarshal.cs.

27 : struct
28 {
29 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
30 {
31 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
32 }
33 return new Span<byte>(ref Unsafe.As<T, byte>(ref GetReference(span)), checked(span.Length * Unsafe.SizeOf<T>()));
34 }

References System.ThrowHelper.ThrowInvalidTypeWithPointersNotSupported().