Class ImageIO

java.lang.Object
javax.imageio.ImageIO

public final class ImageIO extends Object
A class containing static convenience methods for locating ImageReaders and ImageWriters, and performing simple encoding and decoding.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an ImageInputStream that will take its input from the given Object.
    Returns an ImageOutputStream that will send its output to the given Object.
    static File
    Returns the current value set by setCacheDirectory, or null if no explicit setting has been made.
    Returns an ImageReader corresponding to the given ImageWriter, if there is one, or null if the plug-in for this ImageWriter does not specify a corresponding ImageReader, or if the given ImageWriter is not registered.
    Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the supplied Object, typically an ImageInputStream.
    Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the named format.
    Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given MIME type.
    Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given suffix.
    Returns an Iterator containing all currently registered ImageTranscoders that claim to be able to transcode between the metadata of the given ImageReader and ImageWriter.
    Returns an ImageWriter corresponding to the given ImageReader, if there is one, or null if the plug-in for this ImageReader does not specify a corresponding ImageWriter, or if the given ImageReader is not registered.
    Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode images of the given layout (specified using an ImageTypeSpecifier) in the given format.
    Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode the named format.
    Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given MIME type.
    Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given suffix.
    static String[]
    Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered readers.
    static String[]
    Returns an array of Strings listing all of the informal format names understood by the current set of registered readers.
    static String[]
    Returns an array of Strings listing all of the MIME types understood by the current set of registered readers.
    static boolean
    Returns the current value set by setUseCache, or true if no explicit setting has been made.
    static String[]
    Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered writers.
    static String[]
    Returns an array of Strings listing all of the informal format names understood by the current set of registered writers.
    static String[]
    Returns an array of Strings listing all of the MIME types understood by the current set of registered writers.
    read(File input)
    Returns a BufferedImage as the result of decoding a supplied File with an ImageReader chosen automatically from among those currently registered.
    Returns a BufferedImage as the result of decoding a supplied InputStream with an ImageReader chosen automatically from among those currently registered.
    read(URL input)
    Returns a BufferedImage as the result of decoding a supplied URL with an ImageReader chosen automatically from among those currently registered.
    Returns a BufferedImage as the result of decoding a supplied ImageInputStream with an ImageReader chosen automatically from among those currently registered.
    static void
    Scans for plug-ins on the application class path, loads their service provider classes, and registers a service provider instance for each one found with the IIORegistry.
    static void
    setCacheDirectory(File cacheDirectory)
    Sets the directory where cache files are to be created.
    static void
    setUseCache(boolean useCache)
    Sets a flag indicating whether a disk-based cache file should be used when creating ImageInputStreams and ImageOutputStreams.
    static boolean
    write(RenderedImage im, String formatName, File output)
    Writes an image using an arbitrary ImageWriter that supports the given format to a File.
    static boolean
    write(RenderedImage im, String formatName, OutputStream output)
    Writes an image using an arbitrary ImageWriter that supports the given format to an OutputStream.
    static boolean
    write(RenderedImage im, String formatName,