This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Yes it is poosible
Posted by Amit Dubey on August 17, 2001 at 4:43 PM
> i need to prevent someone from just replacing the images in my applet. Is there a way how i could check for example the file size of an image from my applet? Or maybe there is a way to check the RGB-values of some pixels in the image? I could then define some final Values for the file-size(or RGB values) of my images and then just compare them with the size of the loaded images...(and if they are not equal for example just display a black rectangle, instead of the applet ). Can someone help me???
> Please mailme if you can( firstname.lastname@example.org ).
> Thank you in advance,
> sincerly Ilya Shabanov
You can use the FileInputStream object and call the function
available() which returns the number of bytes.