Thanks Paul - Jersey rules.
On Thu, Sep 25, 2008 at 2:25 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>
> On Sep 24, 2008, at 10:56 PM, Zach Cox wrote:
>
>> If I have a method that returns an InputStream:
>>
>> @GET
>> public InputStream getSomething()
>> {
>> InputStream stream = ...;
>> return stream;
>> }
>>
>> Is that InputStream eventually closed by Jersey?
>
> Yes, the message body writer for an input stream does this:
>
> public void writeTo(
> InputStream t,
> Class<?> type,
> Type genericType,
> Annotation annotations[],
> MediaType mediaType,
> MultivaluedMap<String, Object> httpHeaders,
> OutputStream entityStream) throws IOException {
> try {
> writeTo(t, entityStream);
> } finally {
> t.close();
> }
> }
>
> Paul.
>
>> If not, is there any
>> way I can explicitly close it after Jersey is done with it?
>>
>> Thanks,
>> Zach
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>