• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization details reqd.

 
Kunaal A Trehan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

1.Consider a case where we are serializing an object on one machine and transporting to some other machine.On the other side besides class files,what all information do we need?

2.Another case lets suppose we are serializing an object and transporting to some other machine.But there class file does not conatin one method which that serialized object has.So in this case some exception wud be thrown.But will that exception wud be thrown when method call is invoked or when object is recreated.


Rgds
Kunal
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The class files for all of the objects serialized - the serialVersionUID in each must match that in the machine that wrote the object.
2. If the serialVersionUID's don't match you get an immediate InvalidClassException. If you force the serialVersionUIDs to match you would get another exception when the method was invoked.
See the discussion of java.io.Serializable in the JavaDocs
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!