Conversion double array to byte array

后端 未结 7 1266
面向向阳花
面向向阳花 2020-12-01 16:35

How do I convert a double[] array to a byte[] array and vice versa?

class Program
{
    static void Main(string[] args)
    {
              


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 17:05

    You should use Buffer.BlockCopy method.

    Look at the pages example, you will clearly understand.

    doubleArray = byteArray.Select(n => {return Convert.ToDouble(n);}).ToArray();
    

提交回复
热议问题