Java (JAXP) XML parsing differences of DocumentBuilder

Is there any kind of difference between

  1. DocumentBuilder.parse(InputStream) and
  2. 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?

8
задан Lernkurve 20 November 2015 в 11:50
поделиться