if (this.stream == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ImageIO.write(this.PNGimage, "PNG", baos);
} catch (IOException e) {
throw new GeracaoBoletoException(e); // nao esperado
}
this.stream = new ByteArrayInputStream(baos.toByteArray());
}
return this.stream;
}