1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 16:40:26 +02:00
Beef/BeefLibs/corlib/src/BitConverter.bf

24 lines
469 B
Beef
Raw Normal View History

2019-08-23 11:56:54 -07:00
using System;
using System.Diagnostics.Contracts;
using System.Security;
using System.Diagnostics;
namespace System
{
public static class BitConverter
{
#if BIGENDIAN
public static readonly bool IsLittleEndian /* = false */;
#else
public static readonly bool IsLittleEndian = true;
#endif
public static TTo Convert<TFrom, TTo>(TFrom from)
{
Debug.Assert(sizeof(TFrom) == sizeof(TTo));
var from;
return *(TTo*)(&from);
}
}
}