using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace Ryujinx.Horizon.Sdk { ref struct Writer { private Span _output; public Writer(Span output) { _output = output; } public void Write(T value) where T : unmanaged { MemoryMarshal.Cast(_output)[0] = value; _output = _output.Slice(Unsafe.SizeOf()); } } }