Results 1 to 4 of 4

Thread: What does serialization mean in java?

  1. #1
    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...

  2. #2
    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:

    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/

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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 :

    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.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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.

Similar Threads

  1. Serialization and serialVersionUID in Java
    By pancham in forum Software Development
    Replies: 7
    Last Post: 15-09-2010, 09:38 PM
  2. Binary Serialization in Java
    By blueprats in forum Guides & Tutorials
    Replies: 2
    Last Post: 30-04-2010, 04:22 PM
  3. Serialization in Vb.net
    By samualres in forum Software Development
    Replies: 5
    Last Post: 03-03-2010, 11:23 AM
  4. Advantages of serialization
    By ScarFace 01 in forum Software Development
    Replies: 5
    Last Post: 06-02-2010, 11:51 AM
  5. Some questions regarding serialization
    By MABON in forum Software Development
    Replies: 3
    Last Post: 13-11-2009, 04:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,062,081.85671 seconds with 16 queries