Description
The documentation for IdentityInputStream says:
Note that this class NEVER closes the underlying stream, even when close gets called. Instead, it will read until the end of the stream (until -1 is returned).
Similarly the tutorials also say:
[closing the content stream] will attempt to keep the underlying connection alive by consuming the entity content
However, it appears that is not actually true. The implementation does not try to read the remaining content.
Note however, that changing this might break existing applications because it appears not many users are aware of this behavior (which can be seen by the number of reports about ChunkedInputStream.close() blocking forever).