Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: De-serializing an object with missing child classes Date: Wed, 07 Sep 2011 07:46:46 +0200 Lines: 30 Message-ID: <9coeqfFfujU1@mid.individual.net> References: <774ae53e-c127-4d79-8267-d8c8197d0dfb@z7g2000vbp.googlegroups.com> <9651530b-9ed9-41cc-b686-b0644226a65a@a31g2000vbt.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 1H8yJOVve8j4vO+CZ3gYwgecaN0QTwu0u4jsgnBI43B+4IqJQ= Cancel-Lock: sha1:SyPpAZwoYqbxNLbdFTXZl0kHdjM= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 In-Reply-To: <9651530b-9ed9-41cc-b686-b0644226a65a@a31g2000vbt.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7666 On 06.09.2011 16:17, raphfrk@gmail.com wrote: > On Sep 6, 1:34 pm, Robert Klemme 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/