## org.apache.batik.ext.awt.image.codec.imageio
Class ImageIOImageWriter

    java.lang.Object
      org.apache.batik.ext.awt.image.codec.imageio.ImageIOImageWriter

All Implemented Interfaces:
  java.util.EventListener, javax.imageio.event.IIOWriteWarningListener, ImageWriter

Direct Known Subclasses:
  ImageIOJPEGImageWriter, ImageIOPNGImageWriter, ImageIOTIFFImageWriter

    public class ImageIOImageWriter

extends java.lang.Object
implements ImageWriter, javax.imageio.event.IIOWriteWarningListener

ImageWriter implementation that uses Image I/O to write images.

Constructor Summary
`ImageIOImageWriter(java.lang.String mime)` Main constructor.

Method Summary
`protected static javax.imageio.metadata.IIOMetadataNode` `getChildNode(org.w3c.dom.Node n, java.lang.String name)` Returns a specific metadata child node
`protected javax.imageio.ImageWriteParam` `getDefaultWriteParam(javax.imageio.ImageWriter iiowriter, java.awt.image.RenderedImage image, ImageWriterParams params)` Returns the default write parameters for encoding the image.
`java.lang.String` `getMIMEType()`
`protected javax.imageio.metadata.IIOMetadata` `updateMetadata(javax.imageio.metadata.IIOMetadata meta, ImageWriterParams params)` Updates the metadata information based on the parameters to this writer.
`void` `warningOccurred(javax.imageio.ImageWriter source, int imageIndex, java.lang.String warning)`
`void` `writeImage(java.awt.image.RenderedImage image, java.io.OutputStream out)`
`void` `writeImage(java.awt.image.RenderedImage image, java.io.OutputStream out, ImageWriterParams params)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ImageIOImageWriter

    public ImageIOImageWriter(java.lang.String mime)

  Main constructor.

  Parameters:
    `mime` - the MIME type of the image format

Method Detail

### writeImage

    public void writeImage(java.awt.image.RenderedImage image,
                           java.io.OutputStream out)
                    throws java.io.IOException

  Specified by:
    `writeImage` in interface `ImageWriter`
  Throws:
    `java.io.IOException`
  See Also:
    `ImageWriter.writeImage(java.awt.image.RenderedImage, java.io.OutputStream)`

### writeImage

    public void writeImage(java.awt.image.RenderedImage image,
                           java.io.OutputStream out,
                           ImageWriterParams params)
                    throws java.io.IOException

  Specified by:
    `writeImage` in interface `ImageWriter`
  Throws:
    `java.io.IOException`
  See Also:
    `ImageWriter.writeImage(java.awt.image.RenderedImage, java.io.OutputStream, ImageWriterParams)`

### getDefaultWriteParam

    protected javax.imageio.ImageWriteParam getDefaultWriteParam(javax.imageio.ImageWriter iiowriter,
                                                                 java.awt.image.RenderedImage image,
                                                                 ImageWriterParams params)

  Returns the default write parameters for encoding the image.

  Parameters:
    `iiowriter` - The IIO ImageWriter that will be used
    `image` - the image to be encoded
    `params` - the parameters for this writer instance
  Returns:
    the IIO ImageWriteParam instance

### updateMetadata

    protected javax.imageio.metadata.IIOMetadata updateMetadata(javax.imageio.metadata.IIOMetadata meta,
                                                                ImageWriterParams params)

  Updates the metadata information based on the parameters to this writer.

  Parameters:
    `meta` - the metadata
    `params` - the parameters
  Returns:
    the updated metadata

### getChildNode

    protected static javax.imageio.metadata.IIOMetadataNode getChildNode(org.w3c.dom.Node n,
                                                                         java.lang.String name)

  Returns a specific metadata child node

  Parameters:
    `n` - the base node
    `name` - the name of the child
  Returns:
    the requested child node

### getMIMEType

    public java.lang.String getMIMEType()

  Specified by:
    `getMIMEType` in interface `ImageWriter`
  See Also:
    `ImageWriter.getMIMEType()`

### warningOccurred

    public void warningOccurred(javax.imageio.ImageWriter source,
                                int imageIndex,
                                java.lang.String warning)

  Specified by:
    `warningOccurred` in interface `javax.imageio.event.IIOWriteWarningListener`
  See Also:
    `IIOWriteWarningListener.warningOccurred(javax.imageio.ImageWriter, int, java.lang.String)`

Copyright © 2008 Apache Software Foundation. All Rights Reserved.