I want to send image object through socket... Don't want to store image in sender or receivers computer...
+1
A:
So what have you tried ?
This is a tutorial on client/server communication using Java. This reads from stdin, but in your instance you should probably provide an InputStream on your image object.
Brian Agnew
2009-09-06 13:17:37
+1
A:
Use this serialization for an image object to send it through the socket.
Eran Betzalel
2009-09-06 13:19:41
+1
A:
Use this method:
ImageIO.write(RenderedImage, String, OutputStream)
Use in your situation:
Sender
BufferedImage image = ....;
ImageIO.write(image, "PNG", socket.getOutputStream());
Receiver
BufferedImage image = ImageIO.read(socket.getInputStream());
Martijn Courteaux
2009-09-06 13:56:57