Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Latest commit

 

History

History
74 lines (39 loc) · 2.03 KB

File metadata and controls

74 lines (39 loc) · 2.03 KB

💾 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