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

◆ Write< T >()

unsafe void System.Runtime.InteropServices.SafeBuffer.Write< T > ( ulong byteOffset,
T value )
inlineinherited
Type Constraints
T :struct 

Definition at line 158 of file SafeBuffer.cs.

158 : struct
159 {
161 {
162 throw NotInitialized();
163 }
164 uint num = SizeOf<T>();
165 byte* ptr = (byte*)(void*)handle + byteOffset;
166 SpaceCheck(ptr, num);
167 bool success = false;
168 try
169 {
170 DangerousAddRef(ref success);
171 Buffer.Memmove(ref *ptr, ref Unsafe.As<T, byte>(ref value), num);
172 }
173 finally
174 {
175 if (success)
176 {
178 }
179 }
180 }
unsafe void SpaceCheck(byte *ptr, nuint sizeInBytes)
static InvalidOperationException NotInitialized()
void DangerousAddRef(ref bool success)
Definition SafeHandle.cs:76

References System.Runtime.InteropServices.SafeBuffer._numBytes, System.Runtime.InteropServices.SafeHandle.DangerousAddRef(), System.Runtime.InteropServices.SafeHandle.DangerousRelease(), System.Runtime.InteropServices.SafeHandle.handle, System.Buffer.Memmove(), System.Runtime.InteropServices.SafeBuffer.NotInitialized(), System.Runtime.InteropServices.SafeBuffer.SizeOf< T >(), System.Runtime.InteropServices.SafeBuffer.SpaceCheck(), System.Runtime.InteropServices.SafeBuffer.Uninitialized, and System.value.