public static ushort ToUshort(this IEnumerable <byte> data) { return(MyConvert.ToUshort(data.Take(2).ToArray())); }
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))); }
public static uint ToUint(this IEnumerable <byte> data) { return(MyConvert.ToUInt32(data.Take(4).ToArray())); }