Externalizable Interface in java

This Externalizable interface extends Serializable interface. The Externalizable has two member functions readExternal and writeExternal.

If a class that implements Externalizable must have a default no-argument constructor.

Serialization takes place at writeExternal and Deserializaion takes place at readExternal.

Scenario can be if you would like to encrypt some value to be stored/persisted or you would like to decrypt the value before restoration. You can use the Externalizable.

In POJO class you need write logix for the writeExternal and readExternal because that class implements Externalizable interface.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s