| Author |
Image into serializable object?
|
sai pabb
Greenhorn
Joined: Sep 01, 2010
Posts: 9
|
|
Hello,
I'm new to Java images/IO. I've an api which gives me Image object, All I need to do is save the Image onto the server. So, Applet gets an image from the sanner api, the api returns Image object. I need to serialize this and send this to the servlets. Now the servlet has to save this onto the filesystem. Could you help me through this process?
|
 |
C Popp
Greenhorn
Joined: Aug 08, 2007
Posts: 14
|
|
You can try wrapping the Image object in an ImageIcon object which does implement Serializable.
http://download.oracle.com/javase/1.5.0/docs/api/javax/swing/ImageIcon.html
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Or use ImageIO to turn the image into a byte[]. Use ByteArrayOutputStream and ByteArrayInputStream as intermediaries.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Image into serializable object?
|
|
|