I'm trying to convert a OutputStreamWriter
to a ByteArrayOutputStream
out = new OutputStreamWriter(new FileOutputStream("C:/Repositorio/agora-renewal-base/template/email.html"));
ByteArrayOutputStream templateStream = new ByteArrayOutputStream();
templateHtmlContent = templateStream != null ? IOUtils.toString(templateStream.toByteArray(), Charsets.UTF_8.toString()) : null;
template.process(root, out);
How can I pass the variable out
to ByteArrayOutputStream
to convert it?