public static ImageOutputStream createImageOutputStream (Object output) throws IOException

Returns an ImageOutputStream that will send its output to the given Object. The set of ImageOutputStreamSpis registered with the IIORegistry class is queried and the first one that is able to send output from the supplied object is used to create the returned ImageOutputStream. If no suitable ImageOutputStreamSpi exists, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching.

Parameters:
output    an Object to be used as an output destination, such as a File, writable RandomAccessFile, or OutputStream.

Returns:  an ImageOutputStream, or null.

Exceptions:
IllegalArgumentException    if output is null.
IOException    if a cache file is needed but cannot be created.

See also:
javax.imageio.spi.ImageOutputStreamSpi