Is there any kind of difference between
DocumentBuilder.parse(InputStream)
and DocumentBuilder.parse(InputSource)
? I could only find that for the first case, the parser detects the encoding from the stream so it is safer while in the latter I am not sure if it is required to set the encoding.
Any other points (e.g. performance) I should be aware?