/// <summary>
 /// 字节数组中截取转成64位整型
 /// </summary>
 /// <param name="source"></param>
 /// <param name="start"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static ulong GetULongFromByteArray(byte[] source, int start = 0, DataFormat type = DataFormat.ABCD)
 {
     byte[] b = ByteArrayLib.Get8ByteArray(source, start, type);
     return(b == null ? 0 : BitConverter.ToUInt64(b, 0));
 }
Exemple #2
0
 /// <summary>
 /// 将字节数组中某8个字节转换成Double类型
 /// </summary>
 /// <param name="source">字节数组</param>
 /// <param name="start">开始位置</param>
 /// <param name="type">字节顺序</param>
 /// <returns>Double类型数值</returns>
 public static double GetDoubleFromByteArray(byte[] source, int start = 0, DataFormat type = DataFormat.ABCD)
 {
     byte[] b = ByteArrayLib.Get8ByteArray(source, start, type);
     return(b == null ? 0.0 : BitConverter.ToDouble(b, 0));
 }