public InputStream getInputStream()
throws ResourceStreamNotFoundException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
try {
Template t = cfg.getTemplate(templateName);
t.process(model, new OutputStreamWriter(output));
return new ByteArrayInputStream(output.toByteArray());
} catch (IOException e) {
throw (ResourceStreamNotFoundException) new ResourceStreamNotFoundException(
"Could not find template for: " + clazz).initCause(e);