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

            return(IsLittleEndian ? Endian.SwapUInt16(netV) : netV);
        }