Beispiel #1
0
 public static ushort ToUshort(this IEnumerable <byte> data)
 {
     return(MyConvert.ToUshort(data.Take(2).ToArray()));
 }
Beispiel #2
0
        public static ushort GetUshort(byte[] data, int startByte, int startBit, int len) //不考虑跨字节
        {
            int tmp = MyConvert.ToUshort(data, startByte);

            return(Convert.ToUInt16(tmp >> (startBit - len + 9) & 0xffff >> (16 - len)));
        }
Beispiel #3
0
 public static uint ToUint(this IEnumerable <byte> data)
 {
     return(MyConvert.ToUInt32(data.Take(4).ToArray()));
 }