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);
} catch (TemplateException e) {
throw (ResourceStreamNotFoundException) new ResourceStreamNotFoundException(
"Error in tempalte for: " + clazz).initCause(e);
}
}