mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
24 lines
469 B
Beef
24 lines
469 B
Beef
![]() |
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);
|
||
|
}
|
||
|
}
|
||
|
}
|