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 - if the output has not
been set, or prepareWriteSequence
has not been called.
- UnsupportedOperationException - if
canWriteSequence
returns false
.
- IllegalArgumentException - if image
is
null
.
- UnsupportedOperationException - if image
contains a Raster
and canWriteRasters
returns false
.
- IOException - if an error occurs during writing.