...
This means that the writeUnshared()
and readUnshared()
methods cannot should not be used for round-trip serialization of data structures that require a one-to-one mapping between objects pre-serialization and objects post-deserialization. One common example of such a data structure is a graph or network of objects that may contain reference cycles. It is also important to note that calls to the writeUnshared()
and readUnshared()
methods prevent sharing only of the object referred to by (or returned by) the methods; sharing (or not) being serialized. Sharing of objects reached from references in the unshared object remains unchanged.
...