hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LongkerDandy <longkerda...@gmail.com>
Subject InputStreamEntity not closing InputStream
Date Mon, 11 Apr 2011 02:31:09 GMT
Hi

I noticed the InputStreamEntity.writeTo doesn't close the InputStream when
writing is done.
Compare to FileEntity which closed the FileInputStream in final block.

Does this closed/handled elsewhere? Or I have to handle it myself?

If I have to close it myself, how do I know when the transfer is completed?
Example, I can use the FileInputStream with InputStreamEntity:

InputStream is = new FileInputStream(myFile);
HttpEntity entity = new InputStreamEntity(is, myFile.size());
response.setEntity(entity);

Then how do I close the InputStream properly.

Thanks
LongkerDandy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message