serialization code example

Example 1: what is deserialization

Deserialization; API JSON/XML ^ MAP it to Java Object
(JSON TO JAVA OBJECT)



Serialization; when we MAP a Java object to API JSON
format (CONVERT JAVA OBJECT TO JSON);

Example 2: c# serialize

Tutorial obj = new Tutorial();
    obj.ID = 1;
    obj.Name = ".Net";

    IFormatter formatter = new BinaryFormatter();
    Stream stream = new FileStream(@"E:\ExampleNew.txt",FileMode.Create,FileAccess.Write);

    formatter.Serialize(stream, obj);
    stream.Close();

Example 3: what is serialization

Serialization; when we MAP a Java object to API JSON
format (CONVERT JAVA OBJECT TO JSON);

Deserialization; API JSON/XML ^ MAP it to Java Object
(JSON TO JAVA OBJECT)

Example 4: serialization in api

DE-SERIALIZATION:  JSON --> JAVA OBJECT
SERIALIZATION: 	   JSON <-- JAVA OBJECT

I add jacksonDataBinder dependency in my pom.xml file -> 
it is a json parser. That is used for converting
from java object to json and from json to java object.

Example 5: when to use serializable in java

serialize(empObj);

Tags:

Misc Example