using System;
namespace IOB_UT_NEXT.Objects
{
///
/// Gestione Endianness
///
public static class Endian
{
#region Public Methods
///
/// Scambia MSB/LSB per 16bit
///
///
///
public static UInt16 SwapUInt16(UInt16 inValue)
{
return (UInt16)(((inValue & 0xff00) >> 8) |
((inValue & 0x00ff) << 8));
}
///
/// Scambia MSB/LSB per 32bit
///
///
///
public static UInt32 SwapUInt32(UInt32 inValue)
{
return ((inValue & 0xff000000) >> 24) |
((inValue & 0x00ff0000) >> 8) |
((inValue & 0x0000ff00) << 8) |
((inValue & 0x000000ff) << 24);
}
#endregion Public Methods
}
}