javax.imageio
Class ImageWriter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.imageio.ImageWriter
All Implemented Interfaces:
ImageTranscoder sample code for javax.imageio.ImageTranscoder definition code for javax.imageio.ImageTranscoder

public abstract class ImageWriter
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements ImageTranscoder sample code for javax.imageio.ImageTranscoder definition code for javax.imageio.ImageTranscoder

An abstract superclass for encoding and writing images. This class must be subclassed by classes that write out images in the context of the Java Image I/O framework.

ImageWriter objects are normally instantiated by the service provider class for the specific format. Service provider classes are registered with the IIORegistry, which uses them for format recognition and presentation of available format readers and writers.

See Also:
ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader , ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam , IIORegistry sample code for javax.imageio.spi.IIORegistry definition code for javax.imageio.spi.IIORegistry , ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi

Field Summary
protected  Locale sample code for java.util.Locale definition code for java.util.Locale [] availableLocales sample code for javax.imageio.ImageWriter.availableLocales definition code for javax.imageio.ImageWriter.availableLocales
          An array of Locales that may be used to localize warning messages and compression setting values, or null if localization is not supported.
protected  Locale sample code for java.util.Locale definition code for java.util.Locale locale sample code for javax.imageio.ImageWriter.locale definition code for javax.imageio.ImageWriter.locale
          The current Locale to be used for localization, or null if none has been set.
protected  ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi originatingProvider sample code for javax.imageio.ImageWriter.originatingProvider definition code for javax.imageio.ImageWriter.originatingProvider
          The ImageWriterSpi that instantiated this object, or null if its identity is not known or none exists.
protected  Object sample code for java.lang.Object definition code for java.lang.Object output sample code for javax.imageio.ImageWriter.output definition code for javax.imageio.ImageWriter.output
          The ImageOutputStream or other Object set by setOutput and retrieved by getOutput.
protected  List sample code for java.util.List definition code for java.util.List <IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener > progressListeners sample code for javax.imageio.ImageWriter.progressListeners definition code for javax.imageio.ImageWriter.progressListeners
          A List of currently registered IIOWriteProgressListeners, initialized by default null, which is synonymous with an empty List.
protected  List sample code for java.util.List definition code for java.util.List <IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener > warningListeners sample code for javax.imageio.ImageWriter.warningListeners definition code for javax.imageio.ImageWriter.warningListeners
          A List of currently registered IIOWriteWarningListeners, initialized by default to null, which is synonymous with an empty List.
protected  List sample code for java.util.List definition code for java.util.List <Locale sample code for java.util.Locale definition code for java.util.Locale > warningLocales sample code for javax.imageio.ImageWriter.warningLocales definition code for javax.imageio.ImageWriter.warningLocales
          A List of Locales, one for each element of warningListeners, initialized by default null, which is synonymous with an empty List.
 
Constructor Summary
protected ImageWriter sample code for javax.imageio.ImageWriter.ImageWriter(javax.imageio.spi.ImageWriterSpi) definition code for javax.imageio.ImageWriter.ImageWriter(javax.imageio.spi.ImageWriterSpi) (ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi  originatingProvider)
          Constructs an ImageWriter and sets its originatingProvider instance variable to the supplied value.
 
Method Summary
 void abort sample code for javax.imageio.ImageWriter.abort() definition code for javax.imageio.ImageWriter.abort() ()
          Requests that any current write operation be aborted.
protected  boolean abortRequested sample code for javax.imageio.ImageWriter.abortRequested() definition code for javax.imageio.ImageWriter.abortRequested() ()
          Returns true if a request to abort the current write operation has been made since the writer was instantiated or clearAbortRequest was called.
 void addIIOWriteProgressListener sample code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) (IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener  listener)
          Adds an IIOWriteProgressListener to the list of registered progress listeners.
 void addIIOWriteWarningListener sample code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) (IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener  listener)
          Adds an IIOWriteWarningListener to the list of registered warning listeners.
 boolean canInsertEmpty sample code for javax.imageio.ImageWriter.canInsertEmpty(int) definition code for javax.imageio.ImageWriter.canInsertEmpty(int) (int imageIndex)
          Returns true if the writer supports the insertion of a new, empty image at the given index.
 boolean canInsertImage sample code for javax.imageio.ImageWriter.canInsertImage(int) definition code for javax.imageio.ImageWriter.canInsertImage(int) (int imageIndex)
          Returns true if the writer supports the insertion of a new image at the given index.
 boolean canRemoveImage sample code for javax.imageio.ImageWriter.canRemoveImage(int) definition code for javax.imageio.ImageWriter.canRemoveImage(int) (int imageIndex)
          Returns true if the writer supports the removal of an existing image at the given index.
 boolean canReplaceImageMetadata sample code for javax.imageio.ImageWriter.canReplaceImageMetadata(int) definition code for javax.imageio.ImageWriter.canReplaceImageMetadata(int) (int imageIndex)
          Returns true if it is possible to replace the image metadata associated with an existing image with index imageIndex.
 boolean canReplacePixels sample code for javax.imageio.ImageWriter.canReplacePixels(int) definition code for javax.imageio.ImageWriter.canReplacePixels(int) (int imageIndex)
          Returns true if the writer allows pixels of the given image to be replaced using the replacePixels methods.
 boolean canReplaceStreamMetadata sample code for javax.imageio.ImageWriter.canReplaceStreamMetadata() definition code for javax.imageio.ImageWriter.canReplaceStreamMetadata() ()
          Returns true if it is possible to replace the stream metadata already present in the output.
 boolean canWriteEmpty sample code for javax.imageio.ImageWriter.canWriteEmpty() definition code for javax.imageio.ImageWriter.canWriteEmpty() ()
          Returns true if the writer supports the writing of a complete image stream consisting of a single image with undefined pixel values and associated metadata and thumbnails to the output.
 boolean canWriteRasters sample code for javax.imageio.ImageWriter.canWriteRasters() definition code for javax.imageio.ImageWriter.canWriteRasters() ()
          Returns true if the methods that take an IIOImage parameter are capable of dealing with a Raster (as opposed to RenderedImage) source image.
 boolean canWriteSequence sample code for javax.imageio.ImageWriter.canWriteSequence() definition code for javax.imageio.ImageWriter.canWriteSequence() ()
          Returns true if the writer is able to append an image to an image stream that already contains header information and possibly prior images.
protected  void clearAbortRequest sample code for javax.imageio.ImageWriter.clearAbortRequest() definition code for javax.imageio.ImageWriter.clearAbortRequest() ()
          Clears any previous abort request.
abstract  IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata convertImageMetadata sample code for javax.imageio.ImageWriter.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  inData, ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.
abstract  IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata convertStreamMetadata sample code for javax.imageio.ImageWriter.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  inData, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.
 void dispose sample code for javax.imageio.ImageWriter.dispose() definition code for javax.imageio.ImageWriter.dispose() ()
          Allows any resources held by this object to be released.
 void endInsertEmpty sample code for javax.imageio.ImageWriter.endInsertEmpty() definition code for javax.imageio.ImageWriter.endInsertEmpty() ()
          Completes the insertion of a new image that was begun with a prior call to prepareInsertEmpty.
 void endReplacePixels sample code for javax.imageio.ImageWriter.endReplacePixels() definition code for javax.imageio.ImageWriter.endReplacePixels() ()
          Terminates a sequence of calls to replacePixels.
 void endWriteEmpty sample code for javax.imageio.ImageWriter.endWriteEmpty() definition code for javax.imageio.ImageWriter.endWriteEmpty() ()
          Completes the writing of a new image that was begun with a prior call to prepareWriteEmpty.
 void endWriteSequence sample code for javax.imageio.ImageWriter.endWriteSequence() definition code for javax.imageio.ImageWriter.endWriteSequence() ()
          Completes the writing of a sequence of images begun with prepareWriteSequence.
 Locale sample code for java.util.Locale definition code for java.util.Locale [] getAvailableLocales sample code for javax.imageio.ImageWriter.getAvailableLocales() definition code for javax.imageio.ImageWriter.getAvailableLocales() ()
          Returns an array of Locales that may be used to localize warning listeners and compression settings.
abstract  IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata getDefaultImageMetadata sample code for javax.imageio.ImageWriter.getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) (ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Returns an IIOMetadata object containing default values for encoding an image of the given type.
abstract  IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata getDefaultStreamMetadata sample code for javax.imageio.ImageWriter.getDefaultStreamMetadata(javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.getDefaultStreamMetadata(javax.imageio.ImageWriteParam) (ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Returns an IIOMetadata object containing default values for encoding a stream of images.
 ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam getDefaultWriteParam sample code for javax.imageio.ImageWriter.getDefaultWriteParam() definition code for javax.imageio.ImageWriter.getDefaultWriteParam() ()
          Returns a new ImageWriteParam object of the appropriate type for this file format containing default values, that is, those values that would be used if no ImageWriteParam object were specified.
 Locale sample code for java.util.Locale definition code for java.util.Locale getLocale sample code for javax.imageio.ImageWriter.getLocale() definition code for javax.imageio.ImageWriter.getLocale() ()
          Returns the currently set Locale, or null if none has been set.
 int getNumThumbnailsSupported sample code for javax.imageio.ImageWriter.getNumThumbnailsSupported(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.getNumThumbnailsSupported(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) (ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
          Returns the number of thumbnails suported by the format being written, given the image type and any additional write parameters and metadata objects that will be used during encoding.
 ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi getOriginatingProvider sample code for javax.imageio.ImageWriter.getOriginatingProvider() definition code for javax.imageio.ImageWriter.getOriginatingProvider() ()
          Returns the ImageWriterSpi object that created this ImageWriter, or null if this object was not created through the IIORegistry.
 Object sample code for java.lang.Object definition code for java.lang.Object getOutput sample code for javax.imageio.ImageWriter.getOutput() definition code for javax.imageio.ImageWriter.getOutput() ()
          Returns the ImageOutputStream or other Object set by the most recent call to the setOutput method.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension [] getPreferredThumbnailSizes sample code for javax.imageio.ImageWriter.getPreferredThumbnailSizes(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.getPreferredThumbnailSizes(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) (ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
          Returns an array of Dimensions indicating the legal size ranges for thumbnail images as they will be encoded in the output file or stream.
 void prepareInsertEmpty sample code for javax.imageio.ImageWriter.prepareInsertEmpty(int, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.prepareInsertEmpty(int, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List, javax.imageio.ImageWriteParam) (int imageIndex, ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, int width, int height, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata, List sample code for java.util.List definition code for java.util.List <? extends BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage > thumbnails, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Begins the insertion of a new image with undefined pixel values into an existing image stream.
 void prepareReplacePixels sample code for javax.imageio.ImageWriter.prepareReplacePixels(int, java.awt.Rectangle) definition code for javax.imageio.ImageWriter.prepareReplacePixels(int, java.awt.Rectangle) (int imageIndex, Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  region)
          Prepares the writer to handle a series of calls to the replacePixels methods.
 void prepareWriteEmpty sample code for javax.imageio.ImageWriter.prepareWriteEmpty(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.prepareWriteEmpty(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List, javax.imageio.ImageWriteParam) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata, ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType, int width, int height, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata, List sample code for java.util.List definition code for java.util.List <? extends BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage > thumbnails, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Begins the writing of a complete image stream, consisting of a single image with undefined pixel values and associated metadata and thumbnails, to the output.
 void prepareWriteSequence sample code for javax.imageio.ImageWriter.prepareWriteSequence(javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.prepareWriteSequence(javax.imageio.metadata.IIOMetadata) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata)
          Prepares a stream to accept a series of subsequent writeToSequence calls, using the provided stream metadata object.
protected  void processImageComplete sample code for javax.imageio.ImageWriter.processImageComplete() definition code for javax.imageio.ImageWriter.processImageComplete() ()
          Broadcasts the completion of an image write to all registered IIOWriteProgressListeners by calling their imageComplete method.
protected  void processImageProgress sample code for javax.imageio.ImageWriter.processImageProgress(float) definition code for javax.imageio.ImageWriter.processImageProgress(float) (float percentageDone)
          Broadcasts the current percentage of image completion to all registered IIOWriteProgressListeners by calling their imageProgress method.
protected  void processImageStarted sample code for javax.imageio.ImageWriter.processImageStarted(int) definition code for javax.imageio.ImageWriter.processImageStarted(int) (int imageIndex)
          Broadcasts the start of an image write to all registered IIOWriteProgressListeners by calling their imageStarted method.
protected  void processThumbnailComplete sample code for javax.imageio.ImageWriter.processThumbnailComplete() definition code for javax.imageio.ImageWriter.processThumbnailComplete() ()
          Broadcasts the completion of a thumbnail write to all registered IIOWriteProgressListeners by calling their thumbnailComplete method.
protected  void processThumbnailProgress sample code for javax.imageio.ImageWriter.processThumbnailProgress(float) definition code for javax.imageio.ImageWriter.processThumbnailProgress(float) (float percentageDone)
          Broadcasts the current percentage of thumbnail completion to all registered IIOWriteProgressListeners by calling their thumbnailProgress method.
protected  void processThumbnailStarted sample code for javax.imageio.ImageWriter.processThumbnailStarted(int, int) definition code for javax.imageio.ImageWriter.processThumbnailStarted(int, int) (int imageIndex, int thumbnailIndex)
          Broadcasts the start of a thumbnail write to all registered IIOWriteProgressListeners by calling their thumbnailStarted method.
protected  void processWarningOccurred sample code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String) definition code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String) (int imageIndex, String sample code for java.lang.String definition code for java.lang.String  warning)
          Broadcasts a warning message to all registered IIOWriteWarningListeners by calling their warningOccurred method.
protected  void processWarningOccurred sample code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String, java.lang.String) definition code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String, java.lang.String) (int imageIndex, String sample code for java.lang.String definition code for java.lang.String  baseName, String sample code for java.lang.String definition code for java.lang.String  keyword)
          Broadcasts a localized warning message to all registered IIOWriteWarningListeners by calling their warningOccurred method with a string taken from a ResourceBundle.
protected  void processWriteAborted sample code for javax.imageio.ImageWriter.processWriteAborted() definition code for javax.imageio.ImageWriter.processWriteAborted() ()
          Broadcasts that the write has been aborted to all registered IIOWriteProgressListeners by calling their writeAborted method.
 void removeAllIIOWriteProgressListeners sample code for javax.imageio.ImageWriter.removeAllIIOWriteProgressListeners() definition code for javax.imageio.ImageWriter.removeAllIIOWriteProgressListeners() ()
          Removes all currently registered IIOWriteProgressListener objects.
 void removeAllIIOWriteWarningListeners sample code for javax.imageio.ImageWriter.removeAllIIOWriteWarningListeners() definition code for javax.imageio.ImageWriter.removeAllIIOWriteWarningListeners() ()
          Removes all currently registered IIOWriteWarningListener objects.
 void removeIIOWriteProgressListener sample code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) (IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener  listener)
          Removes an IIOWriteProgressListener from the list of registered progress listeners.
 void removeIIOWriteWarningListener sample code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) (IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener  listener)
          Removes an IIOWriteWarningListener from the list of registered warning listeners.
 void removeImage sample code for javax.imageio.ImageWriter.removeImage(int) definition code for javax.imageio.ImageWriter.removeImage(int) (int imageIndex)
          Removes an image from the stream.
 void replaceImageMetadata sample code for javax.imageio.ImageWriter.replaceImageMetadata(int, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.replaceImageMetadata(int, javax.imageio.metadata.IIOMetadata) (int imageIndex, IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
          Replaces the image metadata associated with an existing image.
 void replacePixels sample code for javax.imageio.ImageWriter.replacePixels(java.awt.image.Raster, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.replacePixels(java.awt.image.Raster, javax.imageio.ImageWriteParam) (Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  raster, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Replaces a portion of an image already present in the output with a portion of the given Raster.
 void replacePixels sample code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam) (RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Replaces a portion of an image already present in the output with a portion of the given image.
 void replaceStreamMetadata sample code for javax.imageio.ImageWriter.replaceStreamMetadata(javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.replaceStreamMetadata(javax.imageio.metadata.IIOMetadata) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata)
          Replaces the stream metadata in the output with new information.
 void reset sample code for javax.imageio.ImageWriter.reset() definition code for javax.imageio.ImageWriter.reset() ()
          Restores the ImageWriter to its initial state.
 void setLocale sample code for javax.imageio.ImageWriter.setLocale(java.util.Locale) definition code for javax.imageio.ImageWriter.setLocale(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
          Sets the current Locale of this ImageWriter to the given value.
 void setOutput sample code for javax.imageio.ImageWriter.setOutput(java.lang.Object) definition code for javax.imageio.ImageWriter.setOutput(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  output)
          Sets the destination to the given ImageOutputStream or other Object.
 void write sample code for javax.imageio.ImageWriter.write(javax.imageio.IIOImage) definition code for javax.imageio.ImageWriter.write(javax.imageio.IIOImage) (IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image)
          Appends a complete image stream containing a single image with default metadata and thumbnails to the output.
abstract  void write sample code for javax.imageio.ImageWriter.write(javax.imageio.metadata.IIOMetadata, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.write(javax.imageio.metadata.IIOMetadata, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) (IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata, IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Appends a complete image stream containing a single image and associated stream and image metadata and thumbnails to the output.
 void write sample code for javax.imageio.ImageWriter.write(java.awt.image.RenderedImage) definition code for javax.imageio.ImageWriter.write(java.awt.image.RenderedImage) (RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
          Appends a complete image stream consisting of a single image with default metadata and thumbnails to the output.
 void writeInsert sample code for javax.imageio.ImageWriter.writeInsert(int, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.writeInsert(int, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) (int imageIndex, IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Inserts a new image into an existing image stream.
 void writeToSequence sample code for javax.imageio.ImageWriter.writeToSequence(javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.writeToSequence(javax.imageio.IIOImage, javax.imageio.ImageWriteParam) (IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image, ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
          Appends a single image and possibly associated metadata and thumbnails, to the output.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

originatingProvider sample code for javax.imageio.ImageWriter.originatingProvider

protected ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi  originatingProvider
The ImageWriterSpi that instantiated this object, or null if its identity is not known or none exists. By default it is initialized to null.


output sample code for javax.imageio.ImageWriter.output

protected Object sample code for java.lang.Object definition code for java.lang.Object  output
The ImageOutputStream or other Object set by setOutput and retrieved by getOutput. By default it is initialized to null.


availableLocales sample code for javax.imageio.ImageWriter.availableLocales

protected Locale sample code for java.util.Locale definition code for java.util.Locale [] availableLocales
An array of Locales that may be used to localize warning messages and compression setting values, or null if localization is not supported. By default it is initialized to null.


locale sample code for javax.imageio.ImageWriter.locale

protected Locale sample code for java.util.Locale definition code for java.util.Locale  locale
The current Locale to be used for localization, or null if none has been set. By default it is initialized to null.


warningListeners sample code for javax.imageio.ImageWriter.warningListeners

protected List sample code for java.util.List definition code for java.util.List <IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener > warningListeners
A List of currently registered IIOWriteWarningListeners, initialized by default to null, which is synonymous with an empty List.


warningLocales sample code for javax.imageio.ImageWriter.warningLocales

protected List sample code for java.util.List definition code for java.util.List <Locale sample code for java.util.Locale definition code for java.util.Locale > warningLocales
A List of Locales, one for each element of warningListeners, initialized by default null, which is synonymous with an empty List.


progressListeners sample code for javax.imageio.ImageWriter.progressListeners

protected List sample code for java.util.List definition code for java.util.List <IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener > progressListeners
A List of currently registered IIOWriteProgressListeners, initialized by default null, which is synonymous with an empty List.

Constructor Detail

ImageWriter sample code for javax.imageio.ImageWriter(javax.imageio.spi.ImageWriterSpi) definition code for javax.imageio.ImageWriter(javax.imageio.spi.ImageWriterSpi)

protected ImageWriter(ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi  originatingProvider)
Constructs an ImageWriter and sets its originatingProvider instance variable to the supplied value.

Subclasses that make use of extensions should provide a constructor with signature (ImageWriterSpi, Object) in order to retrieve the extension object. If the extension object is unsuitable, an IllegalArgumentException should be thrown.

Parameters:
originatingProvider - the ImageWriterSpi that is constructing this object, or null.
Method Detail

getOriginatingProvider sample code for javax.imageio.ImageWriter.getOriginatingProvider() definition code for javax.imageio.ImageWriter.getOriginatingProvider()

public ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi  getOriginatingProvider()
Returns the ImageWriterSpi object that created this ImageWriter, or null if this object was not created through the IIORegistry.

The default implementation returns the value of the originatingProvider instance variable.

Returns:
an ImageWriterSpi, or null.
See Also:
ImageWriterSpi sample code for javax.imageio.spi.ImageWriterSpi definition code for javax.imageio.spi.ImageWriterSpi

setOutput sample code for javax.imageio.ImageWriter.setOutput(java.lang.Object) definition code for javax.imageio.ImageWriter.setOutput(java.lang.Object)

public void setOutput(Object sample code for java.lang.Object definition code for java.lang.Object  output)
Sets the destination to the given ImageOutputStream or other Object. The destination is assumed to be ready to accept data, and will not be closed at the end of each write. This allows distributed imaging applications to transmit a series of images over a single network connection. If output is null, any currently set output will be removed.

If output is an ImageOutputStream, calls to the write, writeToSequence, and prepareWriteEmpty/endWriteEmpty methods will preserve the existing contents of the stream. Other write methods, such as writeInsert, replaceStreamMetadata, replaceImageMetadata, replacePixels, prepareInsertEmpty/endInsertEmpty, and endWriteSequence, require the full contents of the stream to be readable and writable, and may alter any portion of the stream.

Use of a general Object other than an ImageOutputStream is intended for writers that interact directly with an output device or imaging protocol. The set of legal classes is advertised by the writer's service provider's getOutputTypes method; most writers will return a single-element array containing only ImageOutputStream.class to indicate that they accept only an ImageOutputStream.

The default implementation sets the output instance variable to the value of output after checking output against the set of classes advertised by the originating provider, if there is one.

Parameters:
output - the ImageOutputStream or other Object to use for future writing.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if output is not an instance of one of the classes returned by the originating service provider's getOutputTypes method.
See Also:
getOutput() sample code for javax.imageio.ImageWriter.getOutput() definition code for javax.imageio.ImageWriter.getOutput()

getOutput sample code for javax.imageio.ImageWriter.getOutput() definition code for javax.imageio.ImageWriter.getOutput()

public Object sample code for java.lang.Object definition code for java.lang.Object  getOutput()
Returns the ImageOutputStream or other Object set by the most recent call to the setOutput method. If no destination has been set, null is returned.

The default implementation returns the value of the output instance variable.

Returns:
the Object that was specified using setOutput, or null.
See Also:
setOutput(java.lang.Object) sample code for javax.imageio.ImageWriter.setOutput(java.lang.Object) definition code for javax.imageio.ImageWriter.setOutput(java.lang.Object)

getAvailableLocales sample code for javax.imageio.ImageWriter.getAvailableLocales() definition code for javax.imageio.ImageWriter.getAvailableLocales()

public Locale sample code for java.util.Locale definition code for java.util.Locale [] getAvailableLocales()
Returns an array of Locales that may be used to localize warning listeners and compression settings. A return value of null indicates that localization is not supported.

The default implementation returns a clone of the availableLocales instance variable if it is non-null, or else returns null.

Returns:
an array of Locales that may be used as arguments to setLocale, or null.

setLocale sample code for javax.imageio.ImageWriter.setLocale(java.util.Locale) definition code for javax.imageio.ImageWriter.setLocale(java.util.Locale)

public void setLocale(Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
Sets the current Locale of this ImageWriter to the given value. A value of null removes any previous setting, and indicates that the writer should localize as it sees fit.

The default implementation checks locale against the values returned by getAvailableLocales, and sets the locale instance variable if it is found. If locale is null, the instance variable is set to null without any checking.

Parameters:
locale - the desired Locale, or null.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if locale is non-null but is not one of the values returned by getAvailableLocales.
See Also:
getLocale() sample code for javax.imageio.ImageWriter.getLocale() definition code for javax.imageio.ImageWriter.getLocale()

getLocale sample code for javax.imageio.ImageWriter.getLocale() definition code for javax.imageio.ImageWriter.getLocale()

public Locale sample code for java.util.Locale definition code for java.util.Locale  getLocale()
Returns the currently set Locale, or null if none has been set.

The default implementation returns the value of the locale instance variable.

Returns:
the current Locale, or null.
See Also:
setLocale(java.util.Locale) sample code for javax.imageio.ImageWriter.setLocale(java.util.Locale) definition code for javax.imageio.ImageWriter.setLocale(java.util.Locale)

getDefaultWriteParam sample code for javax.imageio.ImageWriter.getDefaultWriteParam() definition code for javax.imageio.ImageWriter.getDefaultWriteParam()

public ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  getDefaultWriteParam()
Returns a new ImageWriteParam object of the appropriate type for this file format containing default values, that is, those values that would be used if no ImageWriteParam object were specified. This is useful as a starting point for tweaking just a few parameters and otherwise leaving the default settings alone.

The default implementation constructs and returns a new ImageWriteParam object that does not allow tiling, progressive encoding, or compression, and that will be localized for the current Locale (i.e., what you would get by calling new ImageWriteParam(getLocale()).

Individual plug-ins may return an instance of ImageWriteParam with additional optional features enabled, or they may return an instance of a plug-in specific subclass of ImageWriteParam.

Returns:
a new ImageWriteParam object containing default values.

getDefaultStreamMetadata sample code for javax.imageio.ImageWriter.getDefaultStreamMetadata(javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.getDefaultStreamMetadata(javax.imageio.ImageWriteParam)

public abstract IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  getDefaultStreamMetadata(ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
Returns an IIOMetadata object containing default values for encoding a stream of images. The contents of the object may be manipulated using either the XML tree structure returned by the IIOMetadata.getAsTree method, an IIOMetadataController object, or via plug-in specific interfaces, and the resulting data supplied to one of the write methods that take a stream metadata parameter.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the stream metadata.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Writers that do not make use of stream metadata (e.g., writers for single-image formats) should return null.

Parameters:
param - an ImageWriteParam that will be used to encode the image, or null.
Returns:
an IIOMetadata object.

getDefaultImageMetadata sample code for javax.imageio.ImageWriter.getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam)

public abstract IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  getDefaultImageMetadata(ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                                                    ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
Returns an IIOMetadata object containing default values for encoding an image of the given type. The contents of the object may be manipulated using either the XML tree structure returned by the IIOMetadata.getAsTree method, an IIOMetadataController object, or via plug-in specific interfaces, and the resulting data supplied to one of the write methods that take a stream metadata parameter.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the image metadata.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Parameters:
imageType - an ImageTypeSpecifier indicating the format of the image to be written later.
param - an ImageWriteParam that will be used to encode the image, or null.
Returns:
an IIOMetadata object.

convertStreamMetadata sample code for javax.imageio.ImageWriter.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam)

public abstract IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  convertStreamMetadata(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  inData,
                                                  ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
Description copied from interface: ImageTranscoder sample code for javax.imageio.ImageTranscoder.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageTranscoder.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam)
Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the stream metadata.

If the supplied ImageWriteParam contains optional setting values not understood by this writer or transcoder, they will be ignored.

Specified by:
convertStreamMetadata sample code for javax.imageio.ImageTranscoder.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageTranscoder.convertStreamMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageWriteParam) in interface ImageTranscoder sample code for javax.imageio.ImageTranscoder definition code for javax.imageio.ImageTranscoder
Parameters:
inData - an IIOMetadata object representing stream metadata, used to initialize the state of the returned object.
param - an ImageWriteParam that will be used to encode the image, or null.
Returns:
an IIOMetadata object, or null if the plug-in does not provide metadata encoding capabilities.

convertImageMetadata sample code for javax.imageio.ImageWriter.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam)

public abstract IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  convertImageMetadata(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  inData,
                                                 ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                                                 ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
Description copied from interface: ImageTranscoder sample code for javax.imageio.ImageTranscoder.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageTranscoder.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam)
Returns an IIOMetadata object that may be used for encoding and optionally modified using its document interfaces or other interfaces specific to the writer plug-in that will be used for encoding.

An optional ImageWriteParam may be supplied for cases where it may affect the structure of the image metadata.

If the supplied ImageWriteParam contains optional setting values not understood by this writer or transcoder, they will be ignored.

Specified by:
convertImageMetadata sample code for javax.imageio.ImageTranscoder.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageTranscoder.convertImageMetadata(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam) in interface ImageTranscoder sample code for javax.imageio.ImageTranscoder definition code for javax.imageio.ImageTranscoder
Parameters:
inData - an IIOMetadata object representing image metadata, used to initialize the state of the returned object.
imageType - an ImageTypeSpecifier indicating the layout and color information of the image with which the metadata will be associated.
param - an ImageWriteParam that will be used to encode the image, or null.
Returns:
an IIOMetadata object, or null if the plug-in does not provide metadata encoding capabilities.

getNumThumbnailsSupported sample code for javax.imageio.ImageWriter.getNumThumbnailsSupported(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.getNumThumbnailsSupported(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata)

public int getNumThumbnailsSupported(ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                                     ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param,
                                     IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata,
                                     IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
Returns the number of thumbnails suported by the format being written, given the image type and any additional write parameters and metadata objects that will be used during encoding. A return value of -1 indicates that insufficient information is available.

An ImageWriteParam may optionally be supplied for cases where it may affect thumbnail handling.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation returns 0.

Parameters:
imageType - an ImageTypeSpecifier indicating the type of image to be written, or null.
param - the ImageWriteParam that will be used for writing, or null.
streamMetadata - an IIOMetadata object that will be used for writing, or null.
imageMetadata - an IIOMetadata object that will be used for writing, or null.
Returns:
the number of thumbnails that may be written given the supplied parameters, or -1 if insufficient information is available.

getPreferredThumbnailSizes sample code for javax.imageio.ImageWriter.getPreferredThumbnailSizes(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.getPreferredThumbnailSizes(javax.imageio.ImageTypeSpecifier, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOMetadata, javax.imageio.metadata.IIOMetadata)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension [] getPreferredThumbnailSizes(ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                                              ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param,
                                              IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata,
                                              IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
Returns an array of Dimensions indicating the legal size ranges for thumbnail images as they will be encoded in the output file or stream. This information is merely advisory; the writer will resize any supplied thumbnails as necessary.

The information is returned as a set of pairs; the first element of a pair contains an (inclusive) minimum width and height, and the second element contains an (inclusive) maximum width and height. Together, each pair defines a valid range of sizes. To specify a fixed size, the same width and height will appear for both elements. A return value of null indicates that the size is arbitrary or unknown.

An ImageWriteParam may optionally be supplied for cases where it may affect thumbnail handling.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation returns null.

Parameters:
imageType - an ImageTypeSpecifier indicating the type of image to be written, or null.
param - the ImageWriteParam that will be used for writing, or null.
streamMetadata - an IIOMetadata object that will be used for writing, or null.
imageMetadata - an IIOMetadata object that will be used for writing, or null.
Returns:
an array of Dimensions with an even length of at least two, or null.

canWriteRasters sample code for javax.imageio.ImageWriter.canWriteRasters() definition code for javax.imageio.ImageWriter.canWriteRasters()

public boolean canWriteRasters()
Returns true if the methods that take an IIOImage parameter are capable of dealing with a Raster (as opposed to RenderedImage) source image. If this method returns false, then those methods will throw an UnsupportedOperationException if supplied with an IIOImage containing a Raster.

The default implementation returns false.

Returns:
true if Raster sources are supported.

write sample code for javax.imageio.ImageWriter.write(javax.imageio.metadata.IIOMetadata, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.write(javax.imageio.metadata.IIOMetadata, javax.imageio.IIOImage, javax.imageio.ImageWriteParam)

public abstract void write(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata,
                           IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image,
                           ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                    throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Appends a complete image stream containing a single image and associated stream and image metadata and thumbnails to the output. Any necessary header information is included. If the output is an ImageOutputStream, its existing contents prior to the current seek position are not affected, and need not be readable or writable.

The output must have been set beforehand using the setOutput method.

Stream metadata may optionally be supplied; if it is null, default stream metadata will be used.

If canWriteRasters returns true, the IIOImage may contain a Raster source. Otherwise, it must contain a RenderedImage source.

The supplied thumbnails will be resized if needed, and any thumbnails in excess of the supported number will be ignored. If the format requires additional thumbnails that are not provided, the writer should generate them internally.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

Parameters:
streamMetadata - an IIOMetadata object representing stream metadata, or null to use default values.
image - an IIOImage object containing an image, thumbnails, and metadata to be written.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if image contains a Raster and canWriteRasters returns false.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

write sample code for javax.imageio.ImageWriter.write(javax.imageio.IIOImage) definition code for javax.imageio.ImageWriter.write(javax.imageio.IIOImage)

public void write(IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image)
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Appends a complete image stream containing a single image with default metadata and thumbnails to the output. This method is a shorthand for write(null, image, null).

Parameters:
image - an IIOImage object containing an image, thumbnails, and metadata to be written.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if image contains a Raster and canWriteRasters returns false.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

write sample code for javax.imageio.ImageWriter.write(java.awt.image.RenderedImage) definition code for javax.imageio.ImageWriter.write(java.awt.image.RenderedImage)

public void write(RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Appends a complete image stream consisting of a single image with default metadata and thumbnails to the output. This method is a shorthand for write(null, new IIOImage(image, null, null), null).

Parameters:
image - a RenderedImage to be written.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

canWriteSequence sample code for javax.imageio.ImageWriter.canWriteSequence() definition code for javax.imageio.ImageWriter.canWriteSequence()

public boolean canWriteSequence()
Returns true if the writer is able to append an image to an image stream that already contains header information and possibly prior images.

If canWriteSequence returns false, writeToSequence and endWriteSequence will throw an UnsupportedOperationException.

The default implementation returns false.

Returns:
true if images may be appended sequentially.

prepareWriteSequence sample code for javax.imageio.ImageWriter.prepareWriteSequence(javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.prepareWriteSequence(javax.imageio.metadata.IIOMetadata)

public void prepareWriteSequence(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata)
                          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Prepares a stream to accept a series of subsequent writeToSequence calls, using the provided stream metadata object. The metadata will be written to the stream if it should precede the image data. If the argument is null, default stream metadata is used.

If the output is an ImageOutputStream, the existing contents of the output prior to the current seek position are flushed, and need not be readable or writable. If the format requires that endWriteSequence be able to rewind to patch up the header information, such as for a sequence of images in a single TIFF file, then the metadata written by this method must remain in a writable portion of the stream. Other formats may flush the stream after this method and after each image.

If canWriteSequence returns false, this method will throw an UnsupportedOperationException.

The output must have been set beforehand using either the setOutput method.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
streamMetadata - A stream metadata object, or null.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteSequence returns false.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs writing the stream metadata.

writeToSequence sample code for javax.imageio.ImageWriter.writeToSequence(javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.writeToSequence(javax.imageio.IIOImage, javax.imageio.ImageWriteParam)

public void writeToSequence(IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image,
                            ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                     throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Appends a single image and possibly associated metadata and thumbnails, to the output. If the output is an ImageOutputStream, the existing contents of the output prior to the current seek position may be flushed, and need not be readable or writable, unless the plug-in needs to be able to patch up the header information when endWriteSequence is called (e.g. TIFF).

If canWriteSequence returns false, this method will throw an UnsupportedOperationException.

The output must have been set beforehand using the setOutput method.

prepareWriteSequence must have been called beforehand, or an IllegalStateException is thrown.

If canWriteRasters returns true, the IIOImage may contain a Raster source. Otherwise, it must contain a RenderedImage source.

The supplied thumbnails will be resized if needed, and any thumbnails in excess of the supported number will be ignored. If the format requires additional thumbnails that are not provided, the writer will generate them internally.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
image - an IIOImage object containing an image, thumbnails, and metadata to be written.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set, or prepareWriteSequence has not been called.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteSequence returns false.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if image contains a Raster and canWriteRasters returns false.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

endWriteSequence sample code for javax.imageio.ImageWriter.endWriteSequence() definition code for javax.imageio.ImageWriter.endWriteSequence()

public void endWriteSequence()
                      throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Completes the writing of a sequence of images begun with prepareWriteSequence. Any stream metadata that should come at the end of the sequence of images is written out, and any header information at the beginning of the sequence is patched up if necessary. If the output is an ImageOutputStream, data through the stream metadata at the end of the sequence are flushed and need not be readable or writable.

If canWriteSequence returns false, this method will throw an UnsupportedOperationException.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set, or prepareWriteSequence has not been called.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteSequence returns false.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

canReplaceStreamMetadata sample code for javax.imageio.ImageWriter.canReplaceStreamMetadata() definition code for javax.imageio.ImageWriter.canReplaceStreamMetadata()

public boolean canReplaceStreamMetadata()
                                 throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if it is possible to replace the stream metadata already present in the output.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false.

Returns:
true if replacement of stream metadata is allowed.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

replaceStreamMetadata sample code for javax.imageio.ImageWriter.replaceStreamMetadata(javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.replaceStreamMetadata(javax.imageio.metadata.IIOMetadata)

public void replaceStreamMetadata(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata)
                           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Replaces the stream metadata in the output with new information. If the output is an ImageOutputStream, the prior contents of the stream are examined and possibly edited to make room for the new data. All of the prior contents of the output must be available for reading and writing.

If canReplaceStreamMetadata returns false, an UnsupportedOperationException will be thrown.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
streamMetadata - an IIOMetadata object representing stream metadata, or null to use default values.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if the canReplaceStreamMetadata returns false. modes do not include
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

canReplaceImageMetadata sample code for javax.imageio.ImageWriter.canReplaceImageMetadata(int) definition code for javax.imageio.ImageWriter.canReplaceImageMetadata(int)

public boolean canReplaceImageMetadata(int imageIndex)
                                throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if it is possible to replace the image metadata associated with an existing image with index imageIndex. If this method returns false, a call to replaceImageMetadata(imageIndex) will throw an UnsupportedOperationException.

A writer that does not support any image metadata replacement may return false without performing bounds checking on the index.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false without checking the value of imageIndex.

Parameters:
imageIndex - the index of the image whose metadata is to be replaced.
Returns:
true if the image metadata of the given image can be replaced.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if the writer supports image metadata replacement in general, but imageIndex is less than 0 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

replaceImageMetadata sample code for javax.imageio.ImageWriter.replaceImageMetadata(int, javax.imageio.metadata.IIOMetadata) definition code for javax.imageio.ImageWriter.replaceImageMetadata(int, javax.imageio.metadata.IIOMetadata)

public void replaceImageMetadata(int imageIndex,
                                 IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata)
                          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Replaces the image metadata associated with an existing image.

If canReplaceImageMetadata(imageIndex) returns false, an UnsupportedOperationException will be thrown.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
imageIndex - the index of the image whose metadata is to be replaced.
imageMetadata - an IIOMetadata object representing image metadata, or null.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canReplaceImageMetadata returns false.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if imageIndex is less than 0 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

canInsertImage sample code for javax.imageio.ImageWriter.canInsertImage(int) definition code for javax.imageio.ImageWriter.canInsertImage(int)

public boolean canInsertImage(int imageIndex)
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the writer supports the insertion of a new image at the given index. Existing images with indices greater than or equal to the insertion index will have their indices increased by 1. A value for imageIndex of -1 may be used to signify an index one larger than the current largest index.

A writer that does not support any image insertion may return false without performing bounds checking on the index.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false withour checking the value of imageIndex.

Parameters:
imageIndex - the index at which the image is to be inserted.
Returns:
true if an image may be inserted at the given index.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if the writer supports image insertion in general, but imageIndex is less than -1 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

writeInsert sample code for javax.imageio.ImageWriter.writeInsert(int, javax.imageio.IIOImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.writeInsert(int, javax.imageio.IIOImage, javax.imageio.ImageWriteParam)

public void writeInsert(int imageIndex,
                        IIOImage sample code for javax.imageio.IIOImage definition code for javax.imageio.IIOImage  image,
                        ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                 throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Inserts a new image into an existing image stream. Existing images with an index greater than imageIndex are preserved, and their indices are each increased by 1. A value for imageIndex of -1 may be used to signify an index one larger than the previous largest index; that is, it will cause the image to be logically appended to the end of the sequence. If the output is an ImageOutputStream, the entirety of the stream must be both readable and writeable.

If canInsertImage(imageIndex) returns false, an UnsupportedOperationException will be thrown.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
imageIndex - the index at which to write the image.
image - an IIOImage object containing an image, thumbnails, and metadata to be written.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canInsertImage(imageIndex) returns false.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if imageIndex is less than -1 or greater than the largest available index.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if image contains a Raster and canWriteRasters returns false.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during writing.

canRemoveImage sample code for javax.imageio.ImageWriter.canRemoveImage(int) definition code for javax.imageio.ImageWriter.canRemoveImage(int)

public boolean canRemoveImage(int imageIndex)
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the writer supports the removal of an existing image at the given index. Existing images with indices greater than the insertion index will have their indices decreased by 1.

A writer that does not support any image removal may return false without performing bounds checking on the index.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false without checking the value of imageIndex.

Parameters:
imageIndex - the index of the image to be removed.
Returns:
true if it is possible to remove the given image.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if the writer supports image removal in general, but imageIndex is less than 0 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

removeImage sample code for javax.imageio.ImageWriter.removeImage(int) definition code for javax.imageio.ImageWriter.removeImage(int)

public void removeImage(int imageIndex)
                 throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Removes an image from the stream.

If canRemoveImage(imageIndex) returns false, an UnsupportedOperationExceptionwill be thrown.

The removal may or may not cause a reduction in the actual file size.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
imageIndex - the index of the image to be removed.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canRemoveImage(imageIndex) returns false.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if imageIndex is less than 0 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the removal.

canWriteEmpty sample code for javax.imageio.ImageWriter.canWriteEmpty() definition code for javax.imageio.ImageWriter.canWriteEmpty()

public boolean canWriteEmpty()
                      throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the writer supports the writing of a complete image stream consisting of a single image with undefined pixel values and associated metadata and thumbnails to the output. The pixel values may be defined by future calls to the replacePixels methods. If the output is an ImageOutputStream, its existing contents prior to the current seek position are not affected, and need not be readable or writable.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false.

Returns:
true if the writing of complete image stream with contents to be defined later is supported.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

prepareWriteEmpty sample code for javax.imageio.ImageWriter.prepareWriteEmpty(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List<? extends java.awt.image.BufferedImage>, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.prepareWriteEmpty(javax.imageio.metadata.IIOMetadata, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List<? extends java.awt.image.BufferedImage>, javax.imageio.ImageWriteParam)

public void prepareWriteEmpty(IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  streamMetadata,
                              ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                              int width,
                              int height,
                              IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata,
                              List sample code for java.util.List definition code for java.util.List <? extends BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage > thumbnails,
                              ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Begins the writing of a complete image stream, consisting of a single image with undefined pixel values and associated metadata and thumbnails, to the output. The pixel values will be defined by future calls to the replacePixels methods. If the output is an ImageOutputStream, its existing contents prior to the current seek position are not affected, and need not be readable or writable.

The writing is not complete until a call to endWriteEmpty occurs. Calls to prepareReplacePixels, replacePixels, and endReplacePixels may occur between calls to prepareWriteEmpty and endWriteEmpty. However, calls to prepareWriteEmpty cannot be nested, and calls to prepareWriteEmpty and prepareInsertEmpty may not be interspersed.

If canWriteEmpty returns false, an UnsupportedOperationException will be thrown.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
streamMetadata - an IIOMetadata object representing stream metadata, or null to use default values.
imageType - an ImageTypeSpecifier describing the layout of the image.
width - the width of the image.
height - the height of the image.
imageMetadata - an IIOMetadata object representing image metadata, or null.
thumbnails - a List of BufferedImage thumbnails for this image, or null.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteEmpty returns false.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareWriteEmpty has been made without a corresponding call to endWriteEmpty.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareInsertEmpty has been made without a corresponding call to endInsertEmpty.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if imageType is null or thumbnails contains null references or objects other than BufferedImages.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if width or height are less than 1.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

endWriteEmpty sample code for javax.imageio.ImageWriter.endWriteEmpty() definition code for javax.imageio.ImageWriter.endWriteEmpty()

public void endWriteEmpty()
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Completes the writing of a new image that was begun with a prior call to prepareWriteEmpty.

If canWriteEmpty() returns false, an UnsupportedOperationException will be thrown.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteEmpty(imageIndex) returns false.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareWriteEmpty without a corresponding call to endWriteEmpty has not been made.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareInsertEmpty without a corresponding call to endInsertEmpty has been made.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a call to prepareReiplacePixels has been made without a matching call to endReplacePixels.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

canInsertEmpty sample code for javax.imageio.ImageWriter.canInsertEmpty(int) definition code for javax.imageio.ImageWriter.canInsertEmpty(int)

public boolean canInsertEmpty(int imageIndex)
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the writer supports the insertion of a new, empty image at the given index. The pixel values of the image are undefined, and may be specified in pieces using the replacePixels methods. Existing images with indices greater than or equal to the insertion index will have their indices increased by 1. A value for imageIndex of -1 may be used to signify an index one larger than the current largest index.

A writer that does not support insertion of empty images may return false without performing bounds checking on the index.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false without checking the value of imageIndex.

Parameters:
imageIndex - the index at which the image is to be inserted.
Returns:
true if an empty image may be inserted at the given index.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if the writer supports empty image insertion in general, but imageIndex is less than -1 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

prepareInsertEmpty sample code for javax.imageio.ImageWriter.prepareInsertEmpty(int, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List<? extends java.awt.image.BufferedImage>, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.prepareInsertEmpty(int, javax.imageio.ImageTypeSpecifier, int, int, javax.imageio.metadata.IIOMetadata, java.util.List<? extends java.awt.image.BufferedImage>, javax.imageio.ImageWriteParam)

public void prepareInsertEmpty(int imageIndex,
                               ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  imageType,
                               int width,
                               int height,
                               IIOMetadata sample code for javax.imageio.metadata.IIOMetadata definition code for javax.imageio.metadata.IIOMetadata  imageMetadata,
                               List sample code for java.util.List definition code for java.util.List <? extends BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage > thumbnails,
                               ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                        throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Begins the insertion of a new image with undefined pixel values into an existing image stream. Existing images with an index greater than imageIndex are preserved, and their indices are each increased by 1. A value for imageIndex of -1 may be used to signify an index one larger than the previous largest index; that is, it will cause the image to be logically appended to the end of the sequence. If the output is an ImageOutputStream, the entirety of the stream must be both readable and writeable.

The image contents may be supplied later using the replacePixels method. The insertion is not complete until a call to endInsertEmpty occurs. Calls to prepareReplacePixels, replacePixels, and endReplacePixels may occur between calls to prepareInsertEmpty and endInsertEmpty. However, calls to prepareInsertEmpty cannot be nested, and calls to prepareWriteEmpty and prepareInsertEmpty may not be interspersed.

If canInsertEmpty(imageIndex) returns false, an UnsupportedOperationException will be thrown.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
imageIndex - the index at which to write the image.
imageType - an ImageTypeSpecifier describing the layout of the image.
width - the width of the image.
height - the height of the image.
imageMetadata - an IIOMetadata object representing image metadata, or null.
thumbnails - a List of BufferedImage thumbnails for this image, or null.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canInsertEmpty(imageIndex) returns false.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if imageIndex is less than -1 or greater than the largest available index.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareInsertEmpty has been made without a corresponding call to endInsertEmpty.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareWriteEmpty has been made without a corresponding call to endWriteEmpty.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if imageType is null or thumbnails contains null references or objects other than BufferedImages.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if width or height are less than 1.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

endInsertEmpty sample code for javax.imageio.ImageWriter.endInsertEmpty() definition code for javax.imageio.ImageWriter.endInsertEmpty()

public void endInsertEmpty()
                    throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Completes the insertion of a new image that was begun with a prior call to prepareInsertEmpty.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canInsertEmpty(imageIndex) returns false.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareInsertEmpty without a corresponding call to endInsertEmpty has not been made.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a previous call to prepareWriteEmpty without a corresponding call to endWriteEmpty has been made.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if a call to prepareReplacePixels has been made without a matching call to endReplacePixels.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

canReplacePixels sample code for javax.imageio.ImageWriter.canReplacePixels(int) definition code for javax.imageio.ImageWriter.canReplacePixels(int)

public boolean canReplacePixels(int imageIndex)
                         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the writer allows pixels of the given image to be replaced using the replacePixels methods.

A writer that does not support any pixel replacement may return false without performing bounds checking on the index.

The default implementation throws an IllegalStateException if the output is null, and otherwise returns false without checking the value of imageIndex.

Parameters:
imageIndex - the index of the image whose pixels are to be replaced.
Returns:
true if the pixels of the given image can be replaced.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if the writer supports pixel replacement in general, but imageIndex is less than 0 or greater than the largest available index.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the query.

prepareReplacePixels sample code for javax.imageio.ImageWriter.prepareReplacePixels(int, java.awt.Rectangle) definition code for javax.imageio.ImageWriter.prepareReplacePixels(int, java.awt.Rectangle)

public void prepareReplacePixels(int imageIndex,
                                 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  region)
                          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Prepares the writer to handle a series of calls to the replacePixels methods. The affected pixel area will be clipped against the supplied

If canReplacePixels returns false, and UnsupportedOperationException will be thrown.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
imageIndex - the index of the image whose pixels are to be replaced.
region - a Rectangle that will be used to clip future pixel regions.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canReplacePixels(imageIndex) returns false.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if imageIndex is less than 0 or greater than the largest available index.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if there is a previous call to prepareReplacePixels without a matching call to endReplacePixels (i.e., nesting is not allowed).
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if region is null or has a width or height less than 1.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during the preparation.

replacePixels sample code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam)

public void replacePixels(RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image,
                          ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Replaces a portion of an image already present in the output with a portion of the given image. The image data must match, or be convertible to, the image layout of the existing image.

The destination region is specified in the param argument, and will be clipped to the image boundaries and the region supplied to prepareReplacePixels. At least one pixel of the source must not be clipped, or an exception is thrown.

An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

This method may only be called after a call to prepareReplacePixels, or else an IllegalStateException will be thrown.

The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

Parameters:
image - a RenderedImage containing source pixels.
param - an ImageWriteParam, or null to use a default ImageWriteParam.
Throws:
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canReplacePixels(imageIndex) returns false.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if there is no previous call to prepareReplacePixels without a matching call to endReplacePixels.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if any of the following are true:
  • image is null.
  • param is null.
  • the intersected region does not contain at least one pixel.
  • the layout of image does not match, or this writer cannot convert it to, the existing image layout.
    IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

  • replacePixels sample code for javax.imageio.ImageWriter.replacePixels(java.awt.image.Raster, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.replacePixels(java.awt.image.Raster, javax.imageio.ImageWriteParam)

    public void replacePixels(Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  raster,
                              ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam  param)
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException 
    Replaces a portion of an image already present in the output with a portion of the given Raster. The image data must match, or be convertible to, the image layout of the existing image.

    An ImageWriteParam may optionally be supplied to control the writing process. If param is null, a default write param will be used.

    The destination region is specified in the param argument, and will be clipped to the image boundaries and the region supplied to prepareReplacePixels. At least one pixel of the source must not be clipped, or an exception is thrown.

    If the supplied ImageWriteParam contains optional setting values not supported by this writer (e.g. progressive encoding or any format-specific settings), they will be ignored.

    This method may only be called after a call to prepareReplacePixels, or else an IllegalStateException will be thrown.

    The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

    Parameters:
    raster - a Raster containing source pixels.
    param - an ImageWriteParam, or null to use a default ImageWriteParam.
    Throws:
    IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
    UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canReplacePixels(imageIndex) returns false.
    IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if there is no previous call to prepareReplacePixels without a matching call to endReplacePixels.
    UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canWriteRasters returns false.
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if any of the following are true:
  • raster is null.
  • param is null.
  • the intersected region does not contain at least one pixel.
  • the layout of raster does not match, or this writer cannot convert it to, the existing image layout.
    IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

  • endReplacePixels sample code for javax.imageio.ImageWriter.endReplacePixels() definition code for javax.imageio.ImageWriter.endReplacePixels()

    public void endReplacePixels()
                          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
    Terminates a sequence of calls to replacePixels.

    If canReplacePixels returns false, and UnsupportedOperationException will be thrown.

    The default implementation throws an IllegalStateException if the output is null, and otherwise throws an UnsupportedOperationException.

    Throws:
    IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the output has not been set.
    UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if canReplacePixels(imageIndex) returns false.
    IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if there is no previous call to prepareReplacePixels without a matching call to endReplacePixels.
    IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs during writing.

    abort sample code for javax.imageio.ImageWriter.abort() definition code for javax.imageio.ImageWriter.abort()

    public void abort()
    Requests that any current write operation be aborted. The contents of the output following the abort will be undefined.

    Writers should call clearAbortRequest at the beginning of each write operation, and poll the value of abortRequested regularly during the write.


    abortRequested sample code for javax.imageio.ImageWriter.abortRequested() definition code for javax.imageio.ImageWriter.abortRequested()

    protected boolean abortRequested()
    Returns true if a request to abort the current write operation has been made since the writer was instantiated or clearAbortRequest was called.

    Returns:
    true if the current write operation should be aborted.
    See Also:
    abort() sample code for javax.imageio.ImageWriter.abort() definition code for javax.imageio.ImageWriter.abort() , clearAbortRequest() sample code for javax.imageio.ImageWriter.clearAbortRequest() definition code for javax.imageio.ImageWriter.clearAbortRequest()

    clearAbortRequest sample code for javax.imageio.ImageWriter.clearAbortRequest() definition code for javax.imageio.ImageWriter.clearAbortRequest()

    protected void clearAbortRequest()
    Clears any previous abort request. After this method has been called, abortRequested will return false.

    See Also:
    abort() sample code for javax.imageio.ImageWriter.abort() definition code for javax.imageio.ImageWriter.abort() , abortRequested() sample code for javax.imageio.ImageWriter.abortRequested() definition code for javax.imageio.ImageWriter.abortRequested()

    addIIOWriteWarningListener sample code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener)

    public void addIIOWriteWarningListener(IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener  listener)
    Adds an IIOWriteWarningListener to the list of registered warning listeners. If listener is null, no exception will be thrown and no action will be taken. Messages sent to the given listener will be localized, if possible, to match the current Locale. If no Locale has been set, warning messages may be localized as the writer sees fit.

    Parameters:
    listener - an IIOWriteWarningListener to be registered.
    See Also:
    removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) sample code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener)

    removeIIOWriteWarningListener sample code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener)

    public void removeIIOWriteWarningListener(IIOWriteWarningListener sample code for javax.imageio.event.IIOWriteWarningListener definition code for javax.imageio.event.IIOWriteWarningListener  listener)
    Removes an IIOWriteWarningListener from the list of registered warning listeners. If the listener was not previously registered, or if listener is null, no exception will be thrown and no action will be taken.

    Parameters:
    listener - an IIOWriteWarningListener to be deregistered.
    See Also:
    addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) sample code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener) definition code for javax.imageio.ImageWriter.addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener)

    removeAllIIOWriteWarningListeners sample code for javax.imageio.ImageWriter.removeAllIIOWriteWarningListeners() definition code for javax.imageio.ImageWriter.removeAllIIOWriteWarningListeners()

    public void removeAllIIOWriteWarningListeners()
    Removes all currently registered IIOWriteWarningListener objects.

    The default implementation sets the warningListeners and warningLocales instance variables to null.


    addIIOWriteProgressListener sample code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener)

    public void addIIOWriteProgressListener(IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener  listener)
    Adds an IIOWriteProgressListener to the list of registered progress listeners. If listener is null, no exception will be thrown and no action will be taken.

    Parameters:
    listener - an IIOWriteProgressListener to be registered.
    See Also:
    removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) sample code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener)

    removeIIOWriteProgressListener sample code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener)

    public void removeIIOWriteProgressListener(IIOWriteProgressListener sample code for javax.imageio.event.IIOWriteProgressListener definition code for javax.imageio.event.IIOWriteProgressListener  listener)
    Removes an IIOWriteProgressListener from the list of registered progress listeners. If the listener was not previously registered, or if listener is null, no exception will be thrown and no action will be taken.

    Parameters:
    listener - an IIOWriteProgressListener to be deregistered.
    See Also:
    addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) sample code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener) definition code for javax.imageio.ImageWriter.addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener)

    removeAllIIOWriteProgressListeners sample code for javax.imageio.ImageWriter.removeAllIIOWriteProgressListeners() definition code for javax.imageio.ImageWriter.removeAllIIOWriteProgressListeners()

    public void removeAllIIOWriteProgressListeners()
    Removes all currently registered IIOWriteProgressListener objects.

    The default implementation sets the progressListeners instance variable to null.


    processImageStarted sample code for javax.imageio.ImageWriter.processImageStarted(int) definition code for javax.imageio.ImageWriter.processImageStarted(int)

    protected void processImageStarted(int imageIndex)
    Broadcasts the start of an image write to all registered IIOWriteProgressListeners by calling their imageStarted method. Subclasses may use this method as a convenience.

    Parameters:
    imageIndex - the index of the image about to be written.

    processImageProgress sample code for javax.imageio.ImageWriter.processImageProgress(float) definition code for javax.imageio.ImageWriter.processImageProgress(float)

    protected void processImageProgress(float percentageDone)
    Broadcasts the current percentage of image completion to all registered IIOWriteProgressListeners by calling their imageProgress method. Subclasses may use this method as a convenience.

    Parameters:
    percentageDone - the current percentage of completion, as a float.

    processImageComplete sample code for javax.imageio.ImageWriter.processImageComplete() definition code for javax.imageio.ImageWriter.processImageComplete()

    protected void processImageComplete()
    Broadcasts the completion of an image write to all registered IIOWriteProgressListeners by calling their imageComplete method. Subclasses may use this method as a convenience.


    processThumbnailStarted sample code for javax.imageio.ImageWriter.processThumbnailStarted(int, int) definition code for javax.imageio.ImageWriter.processThumbnailStarted(int, int)

    protected void processThumbnailStarted(int imageIndex,
                                           int thumbnailIndex)
    Broadcasts the start of a thumbnail write to all registered IIOWriteProgressListeners by calling their thumbnailStarted method. Subclasses may use this method as a convenience.

    Parameters:
    imageIndex - the index of the image associated with the thumbnail.
    thumbnailIndex - the index of the thumbnail.

    processThumbnailProgress sample code for javax.imageio.ImageWriter.processThumbnailProgress(float) definition code for javax.imageio.ImageWriter.processThumbnailProgress(float)

    protected void processThumbnailProgress(float percentageDone)
    Broadcasts the current percentage of thumbnail completion to all registered IIOWriteProgressListeners by calling their thumbnailProgress method. Subclasses may use this method as a convenience.

    Parameters:
    percentageDone - the current percentage of completion, as a float.

    processThumbnailComplete sample code for javax.imageio.ImageWriter.processThumbnailComplete() definition code for javax.imageio.ImageWriter.processThumbnailComplete()

    protected void processThumbnailComplete()
    Broadcasts the completion of a thumbnail write to all registered IIOWriteProgressListeners by calling their thumbnailComplete method. Subclasses may use this method as a convenience.


    processWriteAborted sample code for javax.imageio.ImageWriter.processWriteAborted() definition code for javax.imageio.ImageWriter.processWriteAborted()

    protected void processWriteAborted()
    Broadcasts that the write has been aborted to all registered IIOWriteProgressListeners by calling their writeAborted method. Subclasses may use this method as a convenience.


    processWarningOccurred sample code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String) definition code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String)

    protected void processWarningOccurred(int imageIndex,
                                          String sample code for java.lang.String definition code for java.lang.String  warning)
    Broadcasts a warning message to all registered IIOWriteWarningListeners by calling their warningOccurred method. Subclasses may use this method as a convenience.

    Parameters:
    imageIndex - the index of the image on which the warning occurred.
    warning - the warning message.
    Throws:
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if warning is null.

    processWarningOccurred sample code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String, java.lang.String) definition code for javax.imageio.ImageWriter.processWarningOccurred(int, java.lang.String, java.lang.String)

    protected void processWarningOccurred(int imageIndex,
                                          String sample code for java.lang.String definition code for java.lang.String  baseName,
                                          String sample code for java.lang.String definition code for java.lang.String  keyword)
    Broadcasts a localized warning message to all registered IIOWriteWarningListeners by calling their warningOccurred method with a string taken from a ResourceBundle. Subclasses may use this method as a convenience.

    Parameters:
    imageIndex - the index of the image on which the warning occurred.
    baseName - the base name of a set of ResourceBundles containing localized warning messages.
    keyword - the keyword used to index the warning message within the set of ResourceBundles.
    Throws:
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if baseName is null.
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if keyword is null.
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if no appropriate ResourceBundle may be located.
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the named resource is not found in the located ResourceBundle.
    IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the object retrieved from the ResourceBundle is not a String.

    reset sample code for javax.imageio.ImageWriter.reset() definition code for javax.imageio.ImageWriter.reset()

    public void reset()
    Restores the ImageWriter to its initial state.

    The default implementation calls setOutput(null), setLocale(null), removeAllIIOWriteWarningListeners(), removeAllIIOWriteProgressListeners(), and clearAbortRequest.


    dispose sample code for javax.imageio.ImageWriter.dispose() definition code for javax.imageio.ImageWriter.dispose()

    public void dispose()
    Allows any resources held by this object to be released. The result of calling any other method (other than finalize) subsequent to a call to this method is undefined.

    It is important for applications to call this method when they know they will no longer be using this ImageWriter. Otherwise, the writer may continue to hold on to resources indefinitely.

    The default implementation of this method in the superclass does nothing. Subclass implementations should ensure that all resources, especially native resources, are released.