Code example for StreamSource

0
	public ReportTransformer( InputStream xsl) throws TransformerConfigurationException {
		TransformerFactory tFactory = TransformerFactory.newInstance();
		if (xsl == null) {
		    throw new NullPointerException("the input stream for the xsl was null.");
		} 
		this.transformer = tFactory.newTransformer(new StreamSource(xsl));
	} 
 
	public void transform(String inputFile, String outputFile) throws FileNotFoundException, TransformerException {
        transformer.transform(
        new StreamSource(inputFile),
        new StreamResult(new FileOutputStream(outputFile)));
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java