@backstreetbrogrammer
--------------------------------------------------------------------------------
Chapter 14 - Serialization using ObjectStreamField - Code Demo 1
--------------------------------------------------------------------------------
In case of transient keyword, we chose which member fields (primitive and reference) of a class SHOULD NOT participate in serialization and deserialization process.
This is also called as blacklisting.
Using ObjectStreamField class and ObjectOutputStream.putFields and ObjectInputStream.readFields, we can choose which member fields (primitive and reference) of a class SHOULD participate in serialization and deserialization process.
This is also called as whitelisting.
Ideally whitelisting should be preferred over blacklisting as we have full control on which fields to serialize or not.
Java Serialization Playlist: • Java Serialization
Java Serialization Github: https://github.com/backstreetbrogramm...
Dynamic Programming Playlist: • Dynamic Programming
Dynamic Programming Github: https://github.com/backstreetbrogramm...
#java #javadevelopers #javaprogramming #javaserialization