I can't : this InputStream is used by an XML SAX parser (from
org.xml.sax package) that calls the close method at the end of
parsing. [...] But I was just wondering if closing the
socket when just asking to close the *input* side should not been
considered as a painful (conceptual?) bug ...
I'm a bit puzzled by your question. As near as I can tell,
SocketInputStream is part of the Apache library, and it exists for the
sole purpose of providing a stream that will automatically close the
underlying socket when the stream itself is closed.
The docs I'm looking at indicate that you have to provide both a Socket
reference as well as an existing InputStream reference when you
instantiate the SocketInputStream. So presumably you already have a valid
InputStream you _could_ use for parsing.
Why is it that you are using SocketInputStream, given that the one thing
the class appears to do is the one thing that bothers you about it? Why
can't you just pass the original InputStream to the parser?
Pete