conversion from double to byte array and vice versa
<p>i want to convert double array to byte array and byte array to double array</p>

<pre><code>using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Linq;


namespace BitConversion
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] Array = new double[] { 10.0, 20.0, 30.0, 40.0 };
            byte[] byteArray = GetBytesAlt(Array);
            for (int i = 0; i &lt; byteArray.Length; i++)
            {
                Console.Write(byteArray[i]);
                Console.Write(",");

            }

            Console.WriteLine();

            double[] doubleArray = GetDoublesAlt(byteArray);
            for (int i = 0; i &lt; doubleArray.Length; i++)
            {
                Console.Write(doubleArray[i]);
                Console.Write(",");
            }

            Console.WriteLine();

            Console.ReadLine();
        }

        /// &lt;summary&gt;
        /// convert to bytes
        /// &lt;/summary&gt;
        /// &lt;param name="values"&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        static byte[] GetBytesAlt(double[] values)
        {
            /*var result = new byte[values.Length * sizeof(double)];
            Buffer.BlockCopy(values, 0, result, 0, result.Length); 
            return result;*/

            return values.SelectMany(value =&gt; BitConverter.GetBytes(value)).ToArray();

            //return values.SelectMany(value =&gt; BitConverter.GetBytes(value)).ToArray(); 

        }

        static double[] GetDoublesAlt(byte[] bytes)
        {
           /* var result = new double[bytes.Length / sizeof(double)];
            Buffer.BlockCopy(bytes, 0, result, 0, bytes.Length);
            return result;*/
            return Enumerable.Range(0, bytes.Length / sizeof(double)).Select(offset =&gt; BitConverter.ToDouble(bytes, offset * sizeof(double))).ToArray(); 

        }
    }
}
</code></pre>

<p>with the convert approach the when bytes are converted back to the doubles 
the numbers are getting as 10.0,20.0, 30.0, 40.0.....</p>

<p>How to get back the same numbers?</p>

<p>I mean if the double entered is 10.0, 20.0 , 30.0 , 40.0
and i have get back the same number is 10.0,20.0,30.0,40.0.</p>
