You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Benson Margulies <bi...@gmail.com> on 2016/01/27 19:45:42 UTC

Do I hafta have an input stream for HttpEntity?

The documentation for HttpEntity is leaving me a bit puzzled: if I
have content generated on the fly, I can implement writeTo, but I
can't implement getContent() without generating into an array and
making a ByteArrayInputStream. Can I just return null from
getContent()? If so, I will make a PR to clarify the doc.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Do I hafta have an input stream for HttpEntity?

Posted by Benson Margulies <bi...@gmail.com>.
Now I see it in the description of #getContent.

On Wed, Jan 27, 2016 at 2:11 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Wed, 2016-01-27 at 13:45 -0500, Benson Margulies wrote:
>> The documentation for HttpEntity is leaving me a bit puzzled: if I
>> have content generated on the fly, I can implement writeTo, but I
>> can't implement getContent() without generating into an array and
>> making a ByteArrayInputStream. Can I just return null from
>> getContent()? If so, I will make a PR to clarify the doc.
>>
>
> It it legal for #getContent to throw UnsupportedOperationException. I
> think javadoc states that, does not it?
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Do I hafta have an input stream for HttpEntity?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2016-01-27 at 13:45 -0500, Benson Margulies wrote:
> The documentation for HttpEntity is leaving me a bit puzzled: if I
> have content generated on the fly, I can implement writeTo, but I
> can't implement getContent() without generating into an array and
> making a ByteArrayInputStream. Can I just return null from
> getContent()? If so, I will make a PR to clarify the doc.
> 

It it legal for #getContent to throw UnsupportedOperationException. I
think javadoc states that, does not it? 

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org