How do I convert anything into a byte[]? (specifically, lists of arrays of ints...)

I have three things I really need to save to disk once and load in Awake() ever after. (Their values take hours to calculate but will not change.)

I have a List.< int[ ] >, a List.< int >[ ], and a List.[,]. In case the forum php ate my angle brackets, that’s a generic List of int arrays, an array of Lists of ints, and a 2d array of Lists of ints.

:face_with_spiral_eyes:

It seems that no one is even trying to take on something more complex than converting an int[ ] to a byte[ ] and even then there’s a lot of difference of opinion about how best to do it.

I had thought that pretty much everything that exists on a computer and can be fed to a CPU is ‘serializable’ by definition and already ultimately IS a stream of bytes; so why does this have to be such a headache?

Use System.BitConverter.GetBytes.

–Eric