Package codes.thischwa.jii.core
Class ImageIOWrapper
- java.lang.Object
-
- codes.thischwa.jii.core.ImageIOWrapper
-
- All Implemented Interfaces:
IDimensionProvider
,IInfoProvider
public class ImageIOWrapper extends Object implements IDimensionProvider
Wrapper to toImageReader
.- Author:
- Thilo Schwarz
-
-
Constructor Summary
Constructors Constructor Description ImageIOWrapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Dimension
getDimension()
Obtain theDimension
of the current image.ImageType
getImageType()
Obtain theImageType
of the current image file.ImageType[]
getSupportedTypes()
Return allImageType
s supported by the implemented class.static void
main(String[] args)
void
set(File file)
Specify the imageFile
to be examine.void
set(InputStream in)
Specify theInputStream
of image file to be examine.
-
-
-
Method Detail
-
getSupportedTypes
public ImageType[] getSupportedTypes()
Description copied from interface:IInfoProvider
Return allImageType
s supported by the implemented class.- Specified by:
getSupportedTypes
in interfaceIInfoProvider
- Returns:
- A set of
ImageType
s.
-
getImageType
public ImageType getImageType()
Description copied from interface:IInfoProvider
Obtain theImageType
of the current image file.- Specified by:
getImageType
in interfaceIInfoProvider
- Returns:
- The
ImageType
of the current image file.
-
set
public void set(File file) throws FileNotFoundException, ReadException
Description copied from interface:IInfoProvider
Specify the imageFile
to be examine.- Specified by:
set
in interfaceIInfoProvider
- Parameters:
file
- The imageFile
to be examine.- Throws:
FileNotFoundException
- If the file to be examine couldn't find.ReadException
- If the required reading operation fails.
-
set
public void set(InputStream in) throws ReadException, UnsupportedOperationException
Description copied from interface:IInfoProvider
Specify theInputStream
of image file to be examine.- Specified by:
set
in interfaceIInfoProvider
- Parameters:
in
- TheInputStream
of the image file to be examine.- Throws:
ReadException
- If the required reading operation fails.UnsupportedOperationException
- If the implemented class doesn't provide support forInputStream
s.
-
getDimension
public Dimension getDimension() throws ReadException
Description copied from interface:IDimensionProvider
Obtain theDimension
of the current image.- Specified by:
getDimension
in interfaceIDimensionProvider
- Returns:
- The
Dimension
of the current image. - Throws:
ReadException
- If the required operations to determine the dimension fail.
-
-