Re: De-serializing an object with missing child classes
On 06.09.2011 16:17, raphfrk@gmail.com wrote:
On Sep 6, 1:34 pm, Robert Klemme<shortcut...@googlemail.com> wrote:
http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html
Thanks for the info. Is there a way to create a custom deserializer
that can deserialize already serialized classes?
I am not sure I get exactly what you mean here. Do you want to
resurrect class objects (i.e. the code) from the stream? I don't think
this is possible without complex logic.
Or did you mean you want to write a custom deserializer after instances
have been serialized? It might be possible but you would have to know
how the default serializer writes out data. You may be able to find out
by looking at how an array is serialized by default and then emulating
that (IIRC first the length is written and then individual elements).
You certainly need some experimenting to get this going.
Other than that there are some hints in docs about schema change and how
to deal with that (only it's not called "schema change" but they are
talking about class versions). The java.sun.com had some tutorials but
I don't have any links handy.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/