users@jersey.java.net

Re: [Jersey] Multipart 1.0.3 not finding message body reader

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 04 Jun 2009 09:40:12 -0700

On Jun 3, 2009, at 11:42 PM, Ari Heino wrote:
>
> I ment is the stream available outside jersey resource class? F.e.
> if I pass
> the multipart stream object forward to some/any other class and let
> it deal
> with the stream. Would the stream still contain the actual content
> (or be
> "pulled in" with MimePull) even if the stream is only accessed outside
> Jersey code?
>

Yes, it should be scoped to the request, basically before the response
is returned to the client.


> My aim here is that do I need to read the stream content into byte
> array
> inside Jersey resource (therefore using memory also) to be able to
> use the
> stream content anywhere else in my code? Or is it possible to just
> pass the
> stream without reading it's content into memory?
>

Yes, as long as you do the work within the scope of the request, if
you need to use the contents of the stream beyond that scope then you
will have to make your own copy/cache of it.

Paul.