title: Java (JAXP) XML parsing differences of DocumentBuilder
body: <p>Is there any kind of difference between </p>
  
  <ol>
  <li><code>DocumentBuilder.parse(InputStream)</code> and  </li>
  <li><code>DocumentBuilder.parse(InputSource)</code> ?  </li>
  </ol>
  
  <p>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.  </p>
  
  <p>Any other points (e.g. performance) I should be aware?</p>