Skip to content

Commit b4db983

Browse files
authored
README.md
1 parent 6d8a01f commit b4db983

File tree

1 file changed

+15
-0
lines changed
  • DISTRIBUTED ALGORITHMS/ObjectSerialization(Car scanner)

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Explanation:
2+
Serialization: Converting an object into a byte stream to send it over the network or to save it to a file.
3+
Deserialization: Converting the byte stream back into an object.
4+
5+
# Serializing an Object:
6+
Obtain the output stream from the socket to send data to the client.
7+
Create an ObjectOutputStream from the output stream.
8+
Create an instance of the object you want to serialize (e.g., car).
9+
Write the object to the ObjectOutputStream using the writeObject() method.
10+
11+
# Deserializing an Object:
12+
Obtain the input stream from the socket to receive data from the client.
13+
Create an ObjectInputStream from the input stream.
14+
Read the object from the ObjectInputStream using the readObject() method.
15+
Cast the read object to the appropriate type (e.g., car).

0 commit comments

Comments
 (0)