// Retrieve the format.
String format = (String)paramBlock.getObjectParameter(1);
// Retrieve the ImageEncodeParam (which may be null).
ImageEncodeParam param = null;
if(paramBlock.getNumParameters() > 2) {
param = (ImageEncodeParam)paramBlock.getObjectParameter(2);
}
// Create an ImageEncoder.