Here you can find the source of load(InputStream data)
public static Document load(InputStream data) throws SAXException, IOException
//package com.java2s; /*// w ww . ja v a 2s.co m * (c) Kitodo. Key to digital objects e. V. <contact@kitodo.org> * * This file is part of the Kitodo project. * * It is licensed under GNU General Public License version 3 or later. * * For the full copyright and license information, please read the * GPL3-License.txt file that was distributed with this source code. */ import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.SAXException; public class Main { public static Document load(InputStream data) throws SAXException, IOException { try { return DocumentBuilderFactory.newInstance() .newDocumentBuilder().parse(data); } catch (ParserConfigurationException e) { throw new RuntimeException(e.getMessage(), e); } } }