This utility method attempts to determine the XML character encoding by examining the input stream, as specified at w3.
This utility method attempts to determine the XML character encoding by examining the input stream, as specified at w3.
InputStream
to read from.
the name of the encoding.
IOException
if the stream cannot be reset
EncodingHeuristics
reads from a stream (which should be buffered) and attempts to guess what the encoding of the text in the stream is. If it fails to determine the type of the encoding, it returns the default UTF-8.