I have a url of an Image. Now I want to get the byte[] of that image. How can I get that image in byte form.
Actually the image is a captcha image. I am using decaptcher
If you want the byte string as it is stored on disk, just create a socket and open the image file. Then read the bytes as they come down the wire.
I don't have any sample code handy and it's been a while since I've done this, so excuse me if I've got the details wrong to be sure I give this to you straight, but the basic idea would be:
URL imageUrl=new URL("http://someserver.com/somedir/image.jpg");
URLConnection imageConnect=imageUrl.openConnection();
imageConnect.connect();
InputStream is=imageConnect.getInputStream();
... read from the input stream ...