Java provides a mechanism, called object serialization where an object can be represented as a sequence of bytes.
Found this on google. I use .Net to send packets using a socket connection. I use
Serialization is confusing, what is the difference of it to GetBytes?
Best How To :
GetBytes() just converts a
string to its binary represenation using the asked encoding. So it does serialize, but it is very specific to strings.
When you want to serialize any object to bytes, you could use the
BinaryFormatter. More about how to serialize an object using the
BinaryFormatter can be found here.