Converting a User Defined Structure to Byte array

  • Thread starter Thread starter Sal
  • Start date Start date
S

Sal

Is there an easier way to convert a user defined structure
to an array of Bytes ? I am currently using the
System.Bitconverter class with the Copyto Method to
copy one field at a time. Thanks
 
You may want to take a look at Serialization.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconbinaryserialization.asp

<<<<<
Serialization can be defined as the process of storing the state of an
object to a storage medium. During this process, the public and private
fields of the object and the name of the class, including the assembly
containing the class, are converted to a stream of bytes, which is then
written to a data stream. When the object is subsequently deserialized, an
exact clone of the original object is created.
I can add that this feature is very powerful and easy to use.

Vladimir [VB.Net team]

--------------------
 
Back
Top