Skip to main content

Java Object Serialization

Java has a way to covert its object to binary form which called java serialization, then write it to a file  under any extension you want  this means you can store your program data into a form no only you know about the actual structure, 

One of the most major reason that makes it so handy it is JVM independent that means you don't need to have JVM or java virtual machine on. your laptop after you built your java program  

Example : 

If you want to make a program for saving passwords or any sensitive files that you are afraid of intruders  to hack your information you can buy an application from any company, this is the problem that comes in you don't know how they save your data how they encrypting it  so you can use Java serialization for keeping your data safe.

here is how you use it 

you need a class for serializing an object 





















these two methods one which named 
public static void serializeObject(Map<Stage, ArrayList<StudentCard>> student)

is for converting java object with all methods and data into the binary form and the other method which named 

public static Map<Stage, ArrayList<StudentCard>> deserializeObject(String fileName) 

is for bringing back data form wrote file 


and here is how to test it  we have java object of a student which has 11 properties 
name age blood group city mobile number phone number house number email and stage of that student 


you have to make a map for storing data first will take stage which u have specified the state of student you want to save and second is the student object and u the only need to call this two method to perform what you want to do 


what makes it more impressive if you want to encrypt that binary too this makes it even more secure.


Comments

Popular posts from this blog

ACRONIS TRUE IMAGE RECOVER

ACRONIS TRUE IMAGE when you take an image from a window with Acronis true image you have to plug in the external hard drive that you have your image in and also put the disk of Acronis true image, and boot from it and follow the following steps: 1- 2- 3- 4- 5- 6- 7- 8- 9- After when you click the proceed it starts to recover your token image.

Fiber Optic

O ptical f iber   Transmission media are the physical way that  device can connect on network, T ransmission media divided into two parts wired and wireless.each of them have its on types  The optical fiber or fiber optic is one of the most popular and used for transferring data throw content   Optical Fiber Anatomy  Core :   The glass or plastic center of an optical fiber.   Cladding : Glass or plastic surrounding the core of an optical fiber; the optical density of the cladding must be less than that of the core. Optical fibers use reflection to guide light through a channel. The difference in density of the two materials must be such that a beam of light moving through the core is reflected off the cladding instead of being refracted into it.   The composition of a typical fiber-optic cable The outer jacket is made of either PVC or Teflon. Inside the jacket are Kevlar strands to strengthen the cable. Kevlar is a strong