raja.io
Class ImageIO

java.lang.Object
  |
  +--raja.io.ImageIO

public final class ImageIO
extends Object

A class allowing the creation of image readers and writers.

See Also:
ImageReader, ImageWriter

Method Summary
static ImageReader createImageReader(String codec, InputStream is)
          Returns an ImageReader object suitable for decoding images in the given codec from the supplied InputStream, or null if reading in this codec is not supported.
static ImageWriter createImageWriter(String codec, OutputStream os)
          Returns an ImageWriter object suitable for encoding images in the given codec to the supplied OutputStream, or null if writing in this codec is not supported.
static String suffix2Codec(File f)
          Returns the codec name denoted by the name of the given file.
static String suffix2Codec(String fileName)
          Returns the codec name denoted by the suffix of the given file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

suffix2Codec

public static String suffix2Codec(String fileName)
Returns the codec name denoted by the suffix of the given file name. If a codec name cannot be deduced from this file suffix then this method returns null.
Parameters:
fileName - the file name whose suffix to deduce the codec name from.
Returns:
the codec name denoted by the suffix of the given file name.

suffix2Codec

public static String suffix2Codec(File f)
Returns the codec name denoted by the name of the given file. If a codec name cannot be deduced from this file's name then this method returns null.
Parameters:
f - the file whose name to deduce the codec from.
Returns:
the codec name denoted by the given file's name.

createImageReader

public static ImageReader createImageReader(String codec,
                                            InputStream is)
                                     throws IOException
Returns an ImageReader object suitable for decoding images in the given codec from the supplied InputStream, or null if reading in this codec is not supported.
Parameters:
codec - the codec name in which to decode images.
is - the InputStream to read from.
Returns:
an instance of ImageReader suitable for decoding in the given codec, or null.

createImageWriter

public static ImageWriter createImageWriter(String codec,
                                            OutputStream os)
                                     throws IOException
Returns an ImageWriter object suitable for encoding images in the given codec to the supplied OutputStream, or null if writing in this codec is not supported.
Parameters:
codec - the codec name in which to encode images.
os - the OutputStream to write to.
Returns:
an instance of ImageWriter suitable for encoding in the given codec, or null.