The concept of serialization

objects are transmitted in binary mode on the network.
so for serialization, different serialization, the transferred object should be a binary stream.
then why json and xml are also described as serialization. It is not very clear that both of them have to be converted to binary before they can be transmitted
.


for serialization, the transmitted object should be a binary stream for different serialization

I think this sentence is too misleading. Of course, all network transmission data is a binary stream, but that is the underlying implementation; serialization is to convert the objects or data structures in memory into a specific format , which can be either binary, XML, or JSON, because the purpose of serialization is to facilitate the transmission, storage or exchange of data , and its form serves for this purpose. For example, if you choose to serialize to JSON, you can easily debug with the browser when writing the interface, while if you are interacting with the APP side, it may be more appropriate to use protobuf. So all the requirements should be:

look at the scene!
look at the scene!
look at the scene!

although everything is binary when the computer is dealing with it, it is not used in every situation.

Menu