By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

Imageio.read()

P: n/a
Hi ,

I'm trying to send an Image over the Socket Connection (from the
Client using winsock, which is a VB based client) and at the other end
I'm reading the Stream (at the Server which is java based) with the
following code:

InputStream in = client.getInputStream();
BufferedImage rimg = ImageIO.read(in);
File file = new File("d:\\ajay.jpg");
ImageIO.write(rimg, "jpg", file);

Now the problem is, ImageIO.write() method is not able to write the
file until client socket connection closes since the program control
doesn't proceed after Imageio.read() untill the client socket
connection closes.

please help me ....
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"IndianOZ" <aj*********@indiatimes.com> wrote in message
news:ac**************************@posting.google.c om...
Hi ,

I'm trying to send an Image over the Socket Connection (from the
Client using winsock, which is a VB based client) and at the other end
I'm reading the Stream (at the Server which is java based) with the
following code:

InputStream in = client.getInputStream();
BufferedImage rimg = ImageIO.read(in);
File file = new File("d:\\ajay.jpg");
ImageIO.write(rimg, "jpg", file);

Now the problem is, ImageIO.write() method is not able to write the
file until client socket connection closes since the program control
doesn't proceed after Imageio.read() untill the client socket
connection closes.

please help me ....


That probably means that the VB client writes less data than the server
expects thus making it block on the read. Closing the socket will obviously
unblock the server. Does the client flush the socket after writing the data
to it?

Silvio Bierman
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.