mirror of
https://git.zaroz.cloud/nintendo-back-up/Ryujinx.git
synced 2025-12-22 18:32:41 +00:00
17 lines
412 B
C#
17 lines
412 B
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.Common
|
|
{
|
|
public static class BinaryReaderExtensions
|
|
{
|
|
public unsafe static T ReadStruct<T>(this BinaryReader reader)
|
|
where T : unmanaged
|
|
{
|
|
return MemoryMarshal.Cast<byte, T>(reader.ReadBytes(Unsafe.SizeOf<T>()))[0];
|
|
}
|
|
}
|
|
}
|