title: JAI Change JPEG Resolution
body: <p>I am having difficulty using the Java JAI (Java Advance Imaging) API to change the resolution of a JPEG image from lets say 1024x800 to 512x400.</p>
  
  <p>I have played around with the API and keep getting stream or <code>java.lang.OutOfMemory</code> exceptions.</p>
  
  <p>Anyone with a working example.</p>