users@jaxb.java.net

Unmarshalling more than one root element from an InputStream.

From: Krüger Dr., Andreas <Andreas.Krueger_at_alldata.de>
Date: Wed, 12 Feb 2003 13:04:05 +0100

Karlo Berklet wrote:

> 2) When reading from an InputStream associated with a Socket,
> I have to close the corresponding OutputStream on the remote end
> before the object is unmarshalled.

My 2 cents on this one:

Try a "flush" on the remote OutputStream.
The way tcp/ip works, this should get the unmarshalling going
at the local end.

If that does help, you should be able to start unmarshalling anew with the
same,
unclosed InputStream on the local end. Each unmarshalling should give
you one more root element.

That's what I'd try.
I'm not presently an active JAXB user, so "caveat emptor".

If you find the JAXB unmarshalling process closes the InputStream,
you may have to use a facade InputStream that ignores the call to close()
and forwards all other to the real thing.

If you do follow these suggestions,
I'd appreciate to hear from you what came out of them (private email is
fine).

Regards,

Andreas Kr?ger
---
Dr. Andreas Kr?ger
DV-RATIO NORDWEST GmbH
andreas.krueger_at_dv-ratio.com
PGP-Key on request