I have a HttpEntity I received from a web server. If I check that HttpEntity with getContentLength() it shows a value > 0. So there seems to be content. I run getContent() to get an InputStream and on that InputStream I run read() to get the content. On the first read() operation it throws an IO Exception that the stream is closed "Attempted read on closed stream.".
My Code is:
HttpEntity myEntity = myResponse.getEntity();
InputStream inputStream = myEntity.getContent();
inputStream.read();
So I am not calling close() on that stream. I cannot rule out that something is wrong with the HttpEntity, looking at myEntity in the debugger I see (no idea if that helps):
is1=EofSensorInputStream
eofWatcher=BasicManagedEntity
selfClosed=true
wrappedStream=null
getContentLength() on the InputStream shows the value as on the HttpEntity.
I have no clue where to start looking to figure out the issue. What can I check to find the issue?