Skip to content

Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used to persist the object.

Notifications You must be signed in to change notification settings

Shubh2-0/Serialization-in-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ύ Serialization in Java

GitHub stars GitHub forks

Object Persistence in Java

Convert objects to byte streams and back


🎯 About

Learn Java Serialization - converting object state to byte stream for storage or transmission, and restoring it back (deserialization).

πŸ’‘ Concept

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     Serialize      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Java Object  β”‚ ─────────────────► β”‚ Byte Stream  β”‚
β”‚              β”‚ ◄───────────────── β”‚ (File/Network)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    Deserialize     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“š Topics Covered

  • βœ… Serializable interface
  • βœ… ObjectOutputStream
  • βœ… ObjectInputStream
  • βœ… transient keyword
  • βœ… serialVersionUID

πŸ’» Example

// Serialization
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("object.ser"));
oos.writeObject(myObject);

// Deserialization
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("object.ser"));
MyClass obj = (MyClass) ois.readObject();

πŸ› οΈ Technologies

Java | Serializable | Object Streams

πŸ“¬ Contact

LinkedIn Gmail


Keywords: Java Serialization Deserialization Object-Stream Persistence transient

About

Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used to persist the object.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages