• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

serialization question

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question on Serialization. Reference JDK 1.4 Java documentation on ObjectInputStream and ObjectOutputStream.

You can create your own trusted streams by extending ObjectInputStream and ObjectOutputStream. And subsitute a non-serializable object with the serializable one, before writing that to output stream. On the reader end you can resolve, the object and return another to the user. Is this the correct sequence of calls ???

serialization : replaceObject -> writeObject.
deserialization : resolveObject -> readObject. Or resolveobject is called within readObject

Any help will be greatly appreciated.

Thanks
Nishant
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's right. Nice trick with replacing in-stream. I used to add writeReplace() to third-party code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic