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

◆ Read< T >()

static T System.Runtime.InteropServices.MemoryMarshal.Read< T > ( ReadOnlySpan< byte > source)
inlinestatic
Type Constraints
T :struct 

Definition at line 244 of file MemoryMarshal.cs.

244 : struct
245 {
246 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
247 {
248 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
249 }
250 if (Unsafe.SizeOf<T>() > source.Length)
251 {
252 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length);
253 }
254 return Unsafe.ReadUnaligned<T>(ref GetReference(source));
255 }

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