}
Iterator<ImageOutputStreamSpi> it = registry.getServiceProviders(ImageOutputStreamSpi.class, true);
while (it.hasNext()) {
ImageOutputStreamSpi spi = it.next();
if (spi.getOutputClass().isInstance(output)) {
return getUseCache() ?
spi.createOutputStreamInstance(output, true, getCacheDirectory()) :
spi.createOutputStreamInstance(output);
}
}
return null;
}