public class DoubleIt4Impl implements DoubleItMtomPortType {
@Override
public int doubleIt4(int numberToDouble, DataHandler imageData) throws DoubleItFault {
if (numberToDouble == 0) {
throw new DoubleItFault("0 can't be doubled!");
}
try {
BufferedImage image = ImageIO.read(imageData.getInputStream());
if (image == null) {
throw new DoubleItFault("Error processing image data");
}
} catch (IOException e) {
throw new DoubleItFault("Error processing image data: " + e.getMessage());
}
return numberToDouble * 2;
}