Suppose I have an array of arr objects of type A in memory, each of which has a link field pointing to the same object B
Illustration:
A_1 A_2 A_3 ... A_N | | | | | | V | \--->\--> B <-----/
It should be noted that a reference to a field in each object of type A indicates the same strong> object of type B
Now I am serializing an arr array containing objects of type A to an ObjectOutputStream . Then I deserialize the bytes received this way.
I get a new arr1 array.
1) Does the arr1 array arr1 objects of type A such that they all point to the same object of type B ? (I do not mean the same object before serialization, but the only newly created object of type B )
2) In other words, does serialization / deserialization in Java cause the same object graph to be preserved as before serialization? (i.e., a new deserialized graph of objects isomorphic to the old)
3) Where is this documented? (i.e. quote)
4) The same questions 1-3, but apply to Kryo for Java.
Thanks.
source share