title: Java BufferedImage resolution
body: <p>I'm writing a tool in Java to handle uploaded files in my web sites. I'd like to manage images in a particular way: if the size is bigger than the limit, I'd like, first, to resize the image and then check again the size. Naturally I don't want to do useless work, so I'd like to estimate the size of the image before resiz it. At the moment, I use a BufferedImage to store in memory the image but I can't find the way to know the resolution.
  Anyway, can you help me find the right way solve this problem?  </p>
  
  <p>My problem is to know in advance the size in bytes of the resized image. I don't want to do the resize if the final byte size is still over a limit set by the user of the tool.</p>