static class Util
{
/// <summary>
/// 16位字节序调整
/// </summary>
/// <param name="v"></param>
/// <returns></returns>
public static UInt16 swap16(UInt16 v)
{
return (UInt16)(((v & 0x00ff) << 8) | ((v & 0xff00) >> 8));
}
/// <summary>
/// 32位字节序调整
/// </summary>
/// <param name="v"></param>
/// <returns></returns>
public static UInt32 swap32(UInt32 v)
{
return (UInt32)(((v & 0x000000ff) << 24) | ((v & 0x0000ff00) << 8) | ((v & 0x00ff0000) >> 8) | ((v & 0xff000000) >> 24));
}
}