Search code examples
javaserializationrmi

Size of a serialized null values


I have to send through the network a complex object which references are almost all of them Null, but I wonder about the size of this object with this null references inside.

Which is the size of a null value contained in a serialized object?

I am evaluating if it is better to change the communication protocol, sending a simpler object, at the cost of not reusing the complex one, and make several simple one for each kind of communication I have.


Solution

  • The null itself should be 1 byte (0x70) as seen from Object Serialization Stream Protocol