I downloaded data from google.com/favicon.ico and saved it in a file "icon.png" using the following:
URL url=new URL("http://www.google.com/favicon.ico");
InputStream ss=url.openStream();
byte bytes[]=new byte[100000];
int offset = 0;
int numRead = 0;
while (offset < bytes.length && (numRead=ss.read(bytes, offset, bytes.length-offset)) >= 0) {
offset += numRead;
}
FileOutputStream out=new FileOutputStream("icon.png");
out.write(bytes);
Now, icon.png opens normally and shows the google icon. The catch is that when I try to set it as an icon in Qt Jambi, it fails to show up, whereas if I download some icons the normal way, they get loaded properly. My question is that is there any difference between the two ?