Skip to content

Shubh2-0/Serialization-in-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 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

 
 
 

Contributors

Languages