Converting byte array into custom object

  • Thread starter Thread starter Raymond Dynowski
  • Start date Start date
R

Raymond Dynowski

Hello
I am writing a communications link and want to pass data structures between
two applications. When I use sockets, it is looking for a byte buffer to be
used to receive/send the data. How to I convert my own objects into a byte
array type?
For example in C this would have been a piece of cake, we just pass the
address of the data &myObject.
Thanks in advance
Ray
 
As long as the struct is marked as serializable, you could serialize it with
the System.Runtime.Serialization.Formatters.Binary.BinaryFormatter. And
then deserialize it on the other side.
 
Back
Top