Main Site Documentation

Reflection.Serialize() Exception


#1

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));
            }

#2

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


#3

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


#4

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


#5

Look at GHI’s Util class :wink:


#6

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.


#7

Built in = much faster