public static byte[] EncodeUInt16(ushort v) { return(BitConverter.GetBytes(IsLittleEndian ? Endian.SwapUInt16(v) : v)); }
public static UInt16 DecodeUInt16(byte[] data) { UInt16 netV = BitConverter.ToUInt16(data, 0); return(IsLittleEndian ? Endian.SwapUInt16(netV) : netV); }