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

◆ TryWrite< T >()

static bool System.Runtime.InteropServices.MemoryMarshal.TryWrite< T > ( Span< byte > destination,
ref T value )
inlinestatic
Type Constraints
T :struct 

Definition at line 288 of file MemoryMarshal.cs.

288 : struct
289 {
290 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
291 {
292 ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(typeof(T));
293 }
294 if (Unsafe.SizeOf<T>() > (uint)destination.Length)
295 {
296 return false;
297 }
298 Unsafe.WriteUnaligned(ref GetReference(destination), value);
299 return true;
300 }

References System.destination, System.ThrowHelper.ThrowInvalidTypeWithPointersNotSupported(), and System.value.