在 C# 中加倍的字节数组

Byte Array to Double in C#

我设置了一个程序,使用 C# 将双精度值读入字节数组。 该值设置为 1.0 但我得到的字节数组结果是 63 和 128.

例如:

 Byte[] array; // gets result
      //result I get...
   the 0th value - 63
   the 1st value - 128

如何将这些值转换回双精度值 (1.0)?

BitConverter.ToDouble(array, 0);

P.S。如果您使用

之类的东西,它将起作用
BitConverter.GetBytes(1.0)

将 double 打包到数组中。我不明白你所说的第 0 值和第 1 值是什么意思?如果您的字节数组仅包含两个字节 - 它不是双字节。