public static void Write <T>(IntPtr destination, ref T data) where T : struct { unsafe { Interop.CopyInline((void *)destination, ref data); } }
/// <summary> /// Writes the specified T data to a memory location. /// </summary> /// <typeparam name="T">Type of a data to write</typeparam> /// <param name="destination">Memory location to write to.</param> /// <param name="data">The data to write.</param> internal static void UnsafeWrite <T>(IntPtr destination, ref T data) { unsafe { Interop.CopyInline((void *)destination, ref data); } }
public static void Read <T>(IntPtr source, ref T data) where T : struct { unsafe { Interop.CopyInline(ref data, (void *)source); } }