src/main/java/gov/usgs/cida/pubs/transform/CrossrefTransformer.java
protected void writeModelToTemplate(Map<?, ?> model, String templatePath) throws IOException, TemplateException{
		Template t;
		try {
			t = this.templateConfiguration.getTemplate(templatePath);
		} catch (IOException ex) {
			throw new RuntimeException("Error loading template", ex);
		}
		/**
		 * We only want to include reports that are successfully
		 * transformed into Crossref in the output. Thankfully, each
		 * report is small, so we can write each to its own in-memory 
		 * buffer. If the transformation is successful, then the result
		 * is written to the main output. If not, the caller is 
		 * responsible for handling the error.
		*/
		ByteArrayInputStream bais = null;
		try(
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			OutputStreamWriter reportWriter = new OutputStreamWriter(baos)
		) {
			t.process(model, reportWriter);
			bais = new ByteArrayInputStream(baos.toByteArray());
			IOUtils.copy(bais, bufferedWriter, PubsConstantsHelper.DEFAULT_ENCODING);
		} finally {
			closeQuietly(bais);
		}
	}
/**
	 *
	 * @param model
	 * @param templatePath a classpath relative path
	 * @throws java.io.IOException
	 * @throws freemarker.template.TemplateException
	 */
@param model
@param templatePath a classpath relative path
@throws java.io.IOException
@throws freemarker.template.TemplateException
@param model @param templatePath a classpath relative path @throws java . io . IOException @throws freemarker . template . TemplateException
protected void writeModelToTemplate(Map<?, ?> model, String templatePath) throws IOException, TemplateException{
		Template t;
		try {
			t = this.templateConfiguration.getTemplate(templatePath);
		} catch (IOException ex) {
			throw new RuntimeException("Error loading template", ex);
		}
		/**
		 * We only want to include reports that are successfully
		 * transformed into Crossref in the output. Thankfully, each
		 * report is small, so we can write each to its own in-memory 
		 * buffer. If the transformation is successful, then the result
		 * is written to the main output. If not, the caller is 
		 * responsible for handling the error.
		*/
		ByteArrayInputStream bais = null;
		try(
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			OutputStreamWriter reportWriter = new OutputStreamWriter(baos)
		) {
			t.process(model, reportWriter);
			bais = new ByteArrayInputStream(baos.toByteArray());
			IOUtils.copy(bais, bufferedWriter, PubsConstantsHelper.DEFAULT_ENCODING);
		} finally {
			closeQuietly(bais);
		}
	}
protected void writeModelToTemplate ( Map < ? , ? > model , String templatePath ) throws IOException , TemplateException { Template t ; try { t = this . templateConfiguration . getTemplate ( templatePath ) ; } catch ( IOException ex ) { throw new RuntimeException ( "Error loading template" , ex ) ; } /**
		 * We only want to include reports that are successfully
		 * transformed into Crossref in the output. Thankfully, each
		 * report is small, so we can write each to its own in-memory 
		 * buffer. If the transformation is successful, then the result
		 * is written to the main output. If not, the caller is 
		 * responsible for handling the error.
		*/ ByteArrayInputStream bais = null ; try ( ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; OutputStreamWriter reportWriter = new OutputStreamWriter ( baos ) ) { t . process ( model , reportWriter ) ; bais = new ByteArrayInputStream ( baos . toByteArray ( ) ) ; IOUtils . copy ( bais , bufferedWriter , PubsConstantsHelper . DEFAULT_ENCODING ) ; } finally { closeQuietly ( bais ) ; } }
@param model
 @param templatePath a classpath relative path
 @throws java.io.IOException
 @throws freemarker.template.TemplateException
@param model @param templatePath a classpath relative path @throws java . io . IOException @throws freemarker . template . TemplateException