Re: JSR311: entity provider

From: Stephan Koops <>
Date: Fri, 18 Jul 2008 11:56:56 +0200

Hi Marc,

sorry, you misunderstood me; perhaps I wrote not clear enough.
It was meant for a message body READER. Must the InputStream (given to
the message body reader by the runtime) reaches its end, if the length
is reached, or must every provider check the length from the
content-length header and stop itself.
If the runtime environment gives only an InputStream with the length the
provider should read, than the message body readers are easier to
implement and could be used to read "multipart/whatever" data. Then the
multipart provider only must ensure, that the InputStream given to the
readers for every part closes, if the length of the content of this part
is reached.

best regards

Marc Hadley schrieb:
> The spec/javadoc currently says that entity providers shouldn't close
> the stream, I don't think it needs to say anything more ?
> Marc.
> On Jul 17, 2008, at 12:28 PM, Bill Burke wrote:
>> I think the JAX-RS runtime implementation should be closing the
>> stream. YOu can't implement multipart provider very well if the
>> stream is closed , as you said.
>> Stephan Koops wrote:
>>> Hi,
>>> is it the responsibility of an entity provider, to check the length
>>> of the entity, or must the runtime environment must close the
>>> stream? This could be interesting if someone wants to read a
>>> "mutlipart/whatever" entity.
>>> best regards
>>> Stephan