public class TIFFImageEncoder extends ImageEncoderImpl
output, param| Constructor and Description |
|---|
TIFFImageEncoder(OutputStream output,
ImageEncodeParam param) |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(RenderedImage im)
Encodes a RenderedImage and writes the output to the
OutputStream associated with this ImageEncoder.
|
Object |
encodeMultiple(Object context,
RenderedImage img)
Encodes a RenderedImage as part of a multi-page file and writes the output to the
OutputStream associated with this ImageEncoder.
|
void |
finishMultiple(Object context)
Signals the encoder that you've finished sending pages for a multi-page image files.
|
encode, getOutputStream, getParam, setParampublic TIFFImageEncoder(OutputStream output, ImageEncodeParam param)
public void encode(RenderedImage im) throws IOException
encode in interface ImageEncoderencode in class ImageEncoderImplIOExceptionpublic Object encodeMultiple(Object context, RenderedImage img) throws IOException
When you sent all pages, make sure you call finishMultiple() in the end. Otherwise, the generated file will be corrupted.
context - the context object you receive as return value to a previous call to
encodeMultiple(). Set null for the first image.img - the imageIOException - In case of an I/O errorpublic void finishMultiple(Object context) throws IOException
context - the context object you receive as return value to a previous call to
encodeMultiple()IOException - In case of an I/O errorCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.