I have an Image in a webserver and I am getting it through the InputStream of URLConnection.Once I get the Image Object I would like to convert that into it's byte representation so that I can send it ahead.So do you know of any such process by which I can accomplish the above task.
Once you've got an InputStream, you have direct access to the bytes of the image, using one of the various read() methods. So I'm not sure what you're really asking. If you want to "send it ahead" I think you want to create an OutputStream that goes to wherever you're sending the data, and then make a loop that reads from the InputStream and writes to the OutputStream. Perhaps if you clarify what you want we can help better. Also, we ask users to register using a first and last name at JavaRanch. See here for more details.
If you're passing the Image around within java objects you could simply cteate a basic sub-class of Image and have that sub-class implement serializable. Then you could use the Object Streams to pass the data. If you a refering to sending the Image to other apps (i.e. to a browser or ftp server for upload) you can use a java.awt.image.PixelGrabber to get the pixels and then convert them into bytes. This is a convient way to go if you've already got the image in memory and are not reading it in from a file. Just a couple of thoughts Sean