S
Steve
Hi-
I would like to make some of my classes serializable so that I can store
them in a database. I have found some examples showing serializing to a
file, that works fine. I need to serialize to a byte[].
I thought I could just use a MemoryStream and feed it a byte[], but then I
realized I don't know how big to make the byte[]? I'm a newbie and this is
the first time I have ever messed with serialization, but what is the
correct way to get the size of a variable? I looked at
System.Runtime.InteropServices.Marshal.SizeOf() but it complained about not
being able to get any useful size information. The exact exception was:
Type NSTest.MyObject can not be marshaled as an unmanaged structure; no
meaningful size or offset can be computed.
So.... Where do I start. I must be approaching this all worng. Considering
MS has made SOOOO many other things fool proof and easy to do, there must
also be an easy way to serialize to a byte[].
Any help will be greatly appreciated.
Thanks,
Steve
I would like to make some of my classes serializable so that I can store
them in a database. I have found some examples showing serializing to a
file, that works fine. I need to serialize to a byte[].
I thought I could just use a MemoryStream and feed it a byte[], but then I
realized I don't know how big to make the byte[]? I'm a newbie and this is
the first time I have ever messed with serialization, but what is the
correct way to get the size of a variable? I looked at
System.Runtime.InteropServices.Marshal.SizeOf() but it complained about not
being able to get any useful size information. The exact exception was:
Type NSTest.MyObject can not be marshaled as an unmanaged structure; no
meaningful size or offset can be computed.
So.... Where do I start. I must be approaching this all worng. Considering
MS has made SOOOO many other things fool proof and easy to do, there must
also be an easy way to serialize to a byte[].
Any help will be greatly appreciated.
Thanks,
Steve