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?
In a couple of places I’m using writeReplace and readResolve , which sometimes gets
Share
I was told that
Externalizableis much faster than default serialization, as it eliminates the reflection overhead. Working with final fields can be solved by usingwriteReplaceandreadResolve, too, as I recently realized.