ImageWriterSpi spi = (ImageWriterSpi) provider;
ImageReaderSpi spi = (ImageReaderSpi) provider;
    public boolean filter (Object provider)    {      if (provider instanceof ImageReaderSpi)        {          ImageWriterSpi spi = (ImageWriterSpi) provider;          String[] formatNames = spi.getFormatNames();          for (int i = formatNames.length - 1; i >= 0; --i)            if (formatName.equals(formatNames[i]))              return true;        }      return false;    }