41 - Java Serialization using Externalizable - Theory
Автор: Rishi’s programming channel
Загружено: 2022-12-22
Просмотров: 87
Описание:
@backstreetbrogrammer
--------------------------------------------------------------------------------
Chapter 17 - Java Serialization using Externalizable - Theory
--------------------------------------------------------------------------------
If we want to fully control serialization and override JVM default serialization process, we can implement the Externalizable interface and override its methods writeExternal() and readExternal().
Using Externalizable, complete serialization/deserialization logic becomes developer's responsibility.
We need to tell what to serialize using writeExternal() method and what to deserialize using readExternal().
With implementation of writeExternal() and readExternal(), methods writeObject() and readObject() becomes redundant and do not get called.
We can even serialize/deserialize static and transient variables, although it will be a bad practice to do so.
When an Externalizable object is reconstructed, the object is created using public no-arg constructor before the readExternal() method is called.
If a public no-arg constructor is not present then a InvalidClassException is thrown at runtime.
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
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: