Ola pessoal, estou gerando um grafico com JFreeChart e usando RMI, o retorno eh um BufferedImage mas como ele nao eh serializable tenho o seguinte excpetion:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.awt.image.BufferedImage
...
DefaultPieDataset dataSet = new DefaultPieDataset();
for (DtoHistoricoAcesso ac : lista) {
dataSet.setValue(ac.getServico(), ac.getQtd());
}
JFreeChart chart = ChartFactory.createPieChart("Histórico Acessos", dataSet, true, true, true);
return chart.createBufferedImage(530,350);
...
como poderia converter BufferedImage para byte[], stream, algo q seja serializado para ser utilizado com RMI ?