XML allows the encoding of an entity being specified by an external
transport protocol (see 4.3.3): for example, when an XML document
arrives over HTTP with a content type of text/xml, then the encoding
specified in the charset parameter is supposed to take precedence over
that specified in the document entity by the encoding declaration or by
XML's default rules. So I think we need an additional argument here: a
String specifying the name of the encoding to be used for the
InputStream, or null if the encoding specified in the document entity
should be used.
James