hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Exception while consuming Content
Date Tue, 14 Jun 2011 08:27:44 GMT
On Mon, 2011-06-13 at 14:38 -0400, Srinivas wrote:
> I am getting an exception while trying to get the content from a
> HttpResponse.
> 
> Code:
> 
> String message = IOUtils.toString(response.getEntity().getContent());
> ... // Do Something with InputStream
> 
> EntityUtils.close(response.getEntity());
> 
> In EntityUtils class close method; I get an IOException at line 65
> 
> // Line 65
> InputStream instream = entity.getContent();
> 
> The exception is java.io.IOException: Attempted read from closed stream.
> 
> Further debugging; I found that when the response encoding uses gzip
> ("Content-Encoding: gzip"); I get this error. So basically if its a
> BasicHttpEntity instead of GzipDecompressingEntity it works fine. Otherwise
> this exception is thrown.
> 
> Appreciate any inputs into this.
> 
> Thanks,
> Srinivas

Most likely this is the result of this defect

https://issues.apache.org/jira/browse/HTTPCLIENT-1075

Oleg


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


Mime
View raw message