In a couple of places I'm using writeReplace
and readResolve
, which sometimes gets quite verbose. I wonder if using Externalizable
could be better (actually, I don't think so, because my objects are mostly immutable, but I may be wrong). Could you give me some good examples of using Externalizable
?
I don't see how they are even comparable. writeReplace() etc writes a surrogate object for cases when you want to do that; Externalizable takes over the entire serialization of the current object and its base objects.
What was your motivation fo using writeReplace()?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With