Conversion double array to byte array
Assuming you want the doubles placed in the corresponding byte array one after the other, LINQ can make short work out of this: static byte[] GetBytes(double[] values) { return values.SelectMany(value => BitConverter.GetBytes(value)).ToArray(); } Alternatively, you could use Buffer.BlockCopy(): static byte[] GetBytesAlt(double[] values) { var result = new byte[values.Length * sizeof(double)]; Buffer.BlockCopy(values, 0, result, 0, result.Length); … Read more