Reflection.Serialize() Exception

An unhandled exception of type ‘System.NotImplementedException’ occurred in Microsoft.SPOT.Native.dll

That occurs when I use:

public static byte[] GetBytes(double val)
                return Reflection.Serialize(val, typeof(double));

I don’t think that serialization is supported with FEZ Domino (USBizi). I am not sure you have to double check.

Yes serialization is only available on FEZ Cobra.

You shouldn’t use serialization anyway because it is very slow. There are methods to extract values from arrays which what you should be use instead. “Utilities” class

Any suggestions on how to convert a float/double to byte[]?

Look at GHI’s Util class :wink:

facepalm I should have done that before I wrote my own functions for that. Oh well at least it didn’t take long. Time to strip it out and use the built-in stuff.

Built in = much faster