K
Ken Allen
Is there a relatively painless method for converting the contents of a
structure into a byte array and back again?
I have been using Marshal to do this, but it is a pain! To get the byte
array I have to Marshal.StructureToPtr() and then use Marshal.ReadByte()
to extract each of the bytes into an array individually. The reverse is
just as painful.
Is there no general purpose (safe) mechanism for achieving the same thing?
-ken
structure into a byte array and back again?
I have been using Marshal to do this, but it is a pain! To get the byte
array I have to Marshal.StructureToPtr() and then use Marshal.ReadByte()
to extract each of the bytes into an array individually. The reverse is
just as painful.
Is there no general purpose (safe) mechanism for achieving the same thing?
-ken