• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Serialization Process?

 
scott miles
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Object serialization is the process of saving an object's state to a sequence of bytes.
Does it saves only the instance variable or also the object methods(like getter and setter methods) ?
Once we we write the object to outputstream or some text file how does it get transmitted over network?
Do we write the object in a text file right?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is just about data, not methods. Also, static data is not included, since that is class behavior, not object behavior.

Whether it's a text file or a binary file depends on the method of serialization. In the Java world, most commonly it refers to binary serialization using the Object[In|Out]putStream classes. But if the objects conform to the JavaBeans standard, it's also possible to use the XML[En|De]coder classes, which produce a textual representation in XML.
 
Darryl Burke
Bartender
Posts: 5131
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi scott and welcome to the Ranch! We don't have too many rules here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites
http://forums.oracle.com/forums/thread.jspa?threadID=2239994
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic