Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 24-11-2009
Member
 
Join Date: May 2008
Posts: 72
What does serialization mean in java?

Hi All,

I have lots of confusion in the serialization concept of the java.I want to share this problem with you to sort-out the solution over this.

Is this something like encoding? or what?

Please anybody let me know what is serialization in the java?

Your help will be greatly appreciated...
Reply With Quote
  #2  
Old 24-11-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: What does serialization mean in java?

Hi friend,

The procedure of storing an state of the object to a byte sequence along with rebuilding of those bytes in a live object during some future time is called as "serialization in java". The API serialization gives a standard way to the java developers for handling serialization of the object.

Please refer the serialization program:

Quote:
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

public class PersistentTime implements Serializable
{
private Date time;

public PersistentTime()
{
time = Calendar.getInstance().getTime();
}

public Date getTime()
{
return time;
}
}
For more details please visit the below link:

http://java.sun.com/developer/techni...serialization/
Reply With Quote
  #3  
Old 24-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: What does serialization mean in java?

Hi,

I have sound knowledge about the java programming but unfortunately I am not deeply aware about the java serialization. Please see something below can help you :

Quote:
import java.io.*;

public class SerializingObject_demo{

public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter name of the File : ");

String file = in.readLine();

System.out.print("Enter the extention : ");

String ext = in.readLine();

String filename = file + "." + ext;

File f1 = new File(filename);

try{

ObjectOutput ObjOut = new ObjectOutputStream(new FileOutputStream(f));

ObjOut.writeObject(f1);

ObjOut.close();

System.out.println("Serializing completed successfully.");

}

catch(IOException e){

System.out.println(e.getMessage());

}

}

}

Last edited by Katty : 24-11-2009 at 08:36 AM.
Reply With Quote
  #4  
Old 24-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: What does serialization mean in java?

*. Serialization process comprises the storing the object's current state to a stream as well as restoring an object from that particular stream.

*. Serialization in java extends the core Java classes of Output/Input
by using support of objects.

*. In java serialization is used in light-weight persistence & to communicate through RMI(Remote Method
Invocation () OR sockets.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What does serialization mean in java?"
Thread Thread Starter Forum Replies Last Post
Serialization and serialVersionUID in Java pancham Software Development 7 15-09-2010 09:38 PM
Binary Serialization in Java blueprats Guides & Tutorials 2 30-04-2010 04:22 PM
Serialization in Vb.net samualres Software Development 5 03-03-2010 11:23 AM
Advantages of serialization ScarFace 01 Software Development 5 06-02-2010 11:51 AM
Some questions regarding serialization MABON Software Development 3 13-11-2009 04:58 PM


All times are GMT +5.5. The time now is 12:24 AM.