code: public static ImageOutputStream createImageOutputStream(Object output) throws IOException {
  		if (output == null) {
  			throw new IllegalArgumentException("output == null!");
  		}
  
  		Iterator iter;
  		// Ensure category is present
  		try {
  			iter = theRegistry.getServiceProviders(ImageOutputStreamSpi.class, true);
  		} catch (IllegalArgumentException e) {
  			return null;
  		}
  
  		boolean usecache = getUseCache() && hasCachePermission();
  
  		while (iter.hasNext()) {
  			ImageOutputStreamSpi spi = (ImageOutputStreamSpi) iter.next();
  			if (spi.getOutputClass().isInstance(output)) {
  				try {
  					return spi.createOutputStreamInstance(output, usecache, getCacheDirectory());
  				} catch (IOException e) {
  					throw new IIOException("Can't create cache file!", e);
  				}
  			}
  		}
  
  		return null;
  	}
docs: Returns an <code>ImageOutputStream</code> that will send its output to the given <code>Object</code>.
  The set of <code>ImageOutputStreamSpi</code>s registered with the <code>IIORegistry</code> class is
  queried and the first one that is able to send output from the supplied object is used to create the
  returned <code>ImageOutputStream</code>. If no suitable <code>ImageOutputStreamSpi</code> exists,
  <code>null</code> is returned.
  
  <p>
  The current cache settings from <code>getUseCache</code>and <code>getCacheDirectory</code> will be used
  to control caching.
  
  @param output
  an <code>Object</code> to be used as an output destination, such as a <code>File</code>,
  writable <code>RandomAccessFile</code>, or <code>OutputStream</code>.
  
  @return an <code>ImageOutputStream</code>, or <code>null</code>.
  
  @exception IllegalArgumentException
  if <code>output</code> is <code>null</code>.
  @exception IOException
  if a cache file is needed but cannot be created.
  
  @see javax.imageio.spi.ImageOutputStreamSpi