I am facing some problem with my servlet code, I am trying to display the image returned by 3rd party server in the browser.
But it gives me error : The image “http://localhost:8080/velocity/googlechart/” cannot be displayed, because it contains errors.
code is as follows, can someone tell me what I'm doing wrong here ?
ॐ सर्वे जना: सुखिनो भवन्तु , तथास्तु |
'May the whole world be happy, so be it'
Joined: Jun 01, 2010
Note that this is a guess because I've never done this exact thing before. Could it be that you are reading a single character (16 bits), putting it in an int (32 bits) and then writing an int (but the documentation says that this writes a byte (8 bits)? Why don't you try isolating the read/write logic and put it into a simple test program (main). Read a file, write to a new file and see if they are the same.
Joined: May 21, 2007
Thank you very much for your time and reply, problem solved. There was a silly mistake in my previous code.
updated code for getData() method would be