users@jersey.java.net

How to find out content-length *before* unmarshalling?

From: Markus Karg <markus.karg_at_gmx.net>
Date: Sun, 27 Dec 2009 11:22:48 +0100

I need to find out the byte size (content-length) of a JAXB object (i. e.
which content-length *would* be set *if i would* return it as the result of
a JAX-RS method). I know that I could obtain the unmarshaller manually via
the Providers interface, marshal the object and check the resulting size.
But I wonder if there is some smarter way to do that?