Converting a User Defined Structure to Byte array

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
 
V

Vladimir Sadov [MSFT]

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]

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top