Index: src/main/java/javax/imageio/ImageIO.java =================================================================== --- src/main/java/javax/imageio/ImageIO.java (revision 927076) +++ src/main/java/javax/imageio/ImageIO.java (working copy) @@ -27,6 +27,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.ArrayList; import java.util.Iterator; import java.util.Arrays; import java.awt.image.BufferedImage; @@ -102,14 +103,28 @@ return null; } - public static String[] getReaderFormatNames() throws NotImplementedException { - // TODO: implement - throw new NotImplementedException(); + public static String[] getReaderFormatNames() { + ArrayList FormatNames = new ArrayList(); + + Iterator it = registry.getServiceProviders(ImageReaderSpi.class, true); + while (it.hasNext()) { + ImageReaderSpi spi = it.next(); + FormatNames.addAll(Arrays.asList(spi.getFormatNames())); + } + + return (String[])FormatNames.toArray(new String[FormatNames.size()]); } - public static String[] getReaderMIMETypes() throws NotImplementedException { - // TODO: implement - throw new NotImplementedException(); + public static String[] getReaderMIMETypes() { + ArrayList MIMETypes = new ArrayList(); + + Iterator it = registry.getServiceProviders(ImageReaderSpi.class, true); + while (it.hasNext()) { + ImageReaderSpi spi = it.next(); + MIMETypes.addAll(Arrays.asList(spi.getMIMETypes())); + } + + return (String[])MIMETypes.toArray(new String[MIMETypes.size()]); } public static Iterator getImageReaders(Object input) { @@ -151,14 +166,28 @@ new MIMETypeFilter(MIMEType), true)); } - public static String[] getWriterFormatNames() throws NotImplementedException { - // TODO: implement - throw new NotImplementedException(); + public static String[] getWriterFormatNames() { + ArrayList FormatNames = new ArrayList(); + + Iterator it = registry.getServiceProviders(ImageWriterSpi.class, true); + while (it.hasNext()) { + ImageWriterSpi spi = it.next(); + FormatNames.addAll(Arrays.asList(spi.getFormatNames())); + } + + return (String[])FormatNames.toArray(new String[FormatNames.size()]); } - public static String[] getWriterMIMETypes() throws NotImplementedException { - // TODO: implement - throw new NotImplementedException(); + public static String[] getWriterMIMETypes() { + ArrayList MIMETypes = new ArrayList(); + + Iterator it = registry.getServiceProviders(ImageWriterSpi.class, true); + while (it.hasNext()) { + ImageWriterSpi spi = it.next(); + MIMETypes.addAll(Arrays.asList(spi.getMIMETypes())); + } + + return (String[])MIMETypes.toArray(new String[MIMETypes.size()]); } public static Iterator getImageWritersByFormatName(String formatName) {