while (imageTypes.hasNext()) {
if (its.equals((ImageTypeSpecifier) imageTypes.next())) {
break isValid;
}
}
throw new IIOException(Messages.getString("imageio.3", its)); //$NON-NLS-1$
} else {
its = imageTypes.next();
}
} catch (final ClassCastException ex) {
throw new IllegalArgumentException(ex);