|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwjhk.jupload2.filedata.helper.ImageReaderWriterHelper
public class ImageReaderWriterHelper
This package provides low level methods, for picture management. It is used
by PictureFileData to simplify its processing.
| Field Summary | |
|---|---|
(package private) javax.imageio.stream.FileImageInputStream |
fileImageInputStream
File input, from which the original picture should be read. |
(package private) javax.imageio.stream.FileImageOutputStream |
fileImageOutputStream
File output stream for the current transformation. |
(package private) javax.imageio.ImageReader |
imageReader
Current ImageReader. |
(package private) javax.imageio.ImageWriter |
imageWriter
Current ImageWriter. |
(package private) javax.imageio.ImageWriteParam |
imageWriterParam
Current ImageWriter. |
(package private) PictureFileData |
pictureFileData
The PictureFileData that this helper will have to help. |
(package private) java.lang.String |
targetPictureFormat
Contains the target picture format: GIF, JPG... |
(package private) PictureUploadPolicy |
uploadPolicy
The current upload policy must be a PictureUploadPolicy |
| Constructor Summary | |
|---|---|
ImageReaderWriterHelper(PictureUploadPolicy uploadPolicy,
PictureFileData pictureFileData)
Standard constructor. |
|
| Method Summary | |
|---|---|
void |
dispose()
Free all reserved resource by this helper. |
javax.imageio.metadata.IIOMetadata |
getImageMetadata(int imageIndex)
Load the metadata associated with one picture in the picture file. |
int |
getNumImages(boolean allowSearch)
Call to imageReader.getNumImages(boolean). |
java.awt.image.BufferedImage |
imageIORead()
Call to ImageIO.read(fileImageInputStream). |
private void |
initImageReader()
Initialize the ImageReader for the current helper. |
private void |
initImageWriter()
Initialize the ImageWriter and the ImageWriteParam for the current picture helper. |
javax.imageio.IIOImage |
readAll(int imageIndex)
Read an image, from the pictureFileData. |
java.awt.image.BufferedImage |
readImage(int imageIndex)
Read an image, from the pictureFileData. |
void |
setOutput(java.io.File file)
Creates a FileImageOutputStream, and assign it as the output to the imageWriter. |
void |
write(javax.imageio.IIOImage iioImage)
Write a picture in the output picture file. |
void |
writeInsert(int numIndex,
javax.imageio.IIOImage iioImage,
javax.imageio.ImageWriteParam iwp)
Write a picture in the output picture file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
javax.imageio.stream.FileImageInputStream fileImageInputStream
javax.imageio.stream.FileImageOutputStream fileImageOutputStream
PictureFileData pictureFileData
PictureFileData that this helper will have to help.
javax.imageio.ImageReader imageReader
initImageReader()
javax.imageio.ImageWriter imageWriter
initImageWriter()
javax.imageio.ImageWriteParam imageWriterParam
initImageWriter()
java.lang.String targetPictureFormat
PictureUploadPolicy uploadPolicy
PictureUploadPolicy
| Constructor Detail |
|---|
public ImageReaderWriterHelper(PictureUploadPolicy uploadPolicy,
PictureFileData pictureFileData)
uploadPolicy - The current upload policy.pictureFileData - The file data to be 'helped'.| Method Detail |
|---|
public void setOutput(java.io.File file)
throws JUploadIOException
file - The file where the output stream must write.
JUploadIOException - Any error...
public void dispose()
throws JUploadIOException
JUploadIOException - Any IO Exception
public int getNumImages(boolean allowSearch)
throws JUploadIOException
allowSearch -
JUploadIOException
public java.awt.image.BufferedImage imageIORead()
throws JUploadIOException
JUploadIOException
public java.awt.image.BufferedImage readImage(int imageIndex)
throws JUploadIOException,
java.lang.IndexOutOfBoundsException
imageIndex - The index number of the picture, in the file. 0 for the
first picture (only valid value for picture containing one
picture)
JUploadIOException
java.lang.IndexOutOfBoundsException - Occurs when the imageIndex is wrong.
public javax.imageio.IIOImage readAll(int imageIndex)
throws JUploadIOException,
java.lang.IndexOutOfBoundsException
imageIndex - The index number of the picture, in the file. 0 for the
first picture (only valid value for picture containing one
picture)
JUploadIOException
java.lang.IndexOutOfBoundsException - Occurs when the imageIndex is wrong.
public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
throws JUploadIOException
imageIndex -
JUploadIOException - Any IOException is encapsulated in this
exception
public void writeInsert(int numIndex,
javax.imageio.IIOImage iioImage,
javax.imageio.ImageWriteParam iwp)
throws JUploadIOException
numIndex - The index of the image in the transformed picture file.iioImage - The image to write.iwp - The parameter to use to write this image.
JUploadIOException
public void write(javax.imageio.IIOImage iioImage)
throws JUploadIOException
iioImage - The image to write.
JUploadIOException
private void initImageWriter()
throws JUploadIOException
JUploadIOException
private void initImageReader()
throws JUploadIOException
JUploadIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||