filmov
tv
50 - Java Serialization using writeReplace() and readResolve() - Unit Tests Code Demo

Показать описание
@backstreetbrogrammer
--------------------------------------------------------------------------------
Chapter 19 - Java Serialization using writeReplace() and readResolve() - Unit Tests Code Demo
--------------------------------------------------------------------------------
The writeReplace() method allows the developer to provide a replacement object that will be serialized instead of the original one.
The writeReplace() method is run before writeObject() and allows us to replace the object that gets serialized.
Similarly, readResolve() method is used during deserialization process to allow the developer to replace the deserialized object by another one of our choice.
The readResolve() method is run after readObject() method is called.
#java #javadevelopers #javaprogramming #javaserialization
--------------------------------------------------------------------------------
Chapter 19 - Java Serialization using writeReplace() and readResolve() - Unit Tests Code Demo
--------------------------------------------------------------------------------
The writeReplace() method allows the developer to provide a replacement object that will be serialized instead of the original one.
The writeReplace() method is run before writeObject() and allows us to replace the object that gets serialized.
Similarly, readResolve() method is used during deserialization process to allow the developer to replace the deserialized object by another one of our choice.
The readResolve() method is run after readObject() method is called.
#java #javadevelopers #javaprogramming #javaserialization