if (reader == null) {
// imageio.97=Reader cannot be null
throw new IllegalArgumentException(Messages.getString("imageio.97")); //$NON-NLS-1$
}
ImageReaderSpi readerSpi = reader.getOriginatingProvider();
if (readerSpi.getImageWriterSpiNames() == null) {
return null;
}
String writerSpiName = readerSpi.getImageWriterSpiNames()[0];
Iterator<ImageWriterSpi> writerSpis;
writerSpis = registry.getServiceProviders(ImageWriterSpi.class, true);
try {