I have a servlet based application that is serving images from files stored locally. I have added logic that will allow the application to load the image file to a Buffered
Before you load the image file as a BufferedImage make a reference to the image file via the File object.
File imgObj = new File("your Image file path");
int imgLength = (int) imgObj.length();
imgLength would be your approximate image size though it my vary after resizing and then any operations you perform on it.