Question about objectInputStream

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Artemis

Question about objectInputStream

Post by Artemis » Mon Feb 10, 2003 7:57 am

Hi,

I want the servlet to output the chart to the applet,

here's the code I've found in this forum which should be in the servlet,

// create a 50 KB (should be enough) buffer to write to and write to it...
ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(1024*50);
ChartUtilities.writeChartAsPNG(outBuffer, chart, 800, 450);
// get buffer's data
byte[] buf = outBuffer.toByteArray();
// set response information
response.setContentType("image/png");
response.setContentLength(buf.length);
// write the chart data
out = response.getOutputStream();
out.write(buf, 0, buf.length);
// clean up
outBuffer.close();
outBuffer = null;
buf = null;

I want to ask what should I do in the applet to get back this data and return the timeseries chart ?

Thanks for showing me....

Locked