Code example for StreamSource

	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 {
        new StreamSource(inputFile),
        new StreamResult(new FileOutputStream(outputFile)));
Connect your IDE to all the code out there  Get Codota for Java