Java Doc for ImageIO.java in  » 6.0-JDK-Core » image » javax » imageio » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » image » javax.imageio 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.imageio.ImageIO

ImageIO
final public class ImageIO (Code)
A class containing static convenience methods for locating ImageReaders and ImageWriters, and performing simple encoding and decoding.
version:
   0.5

Inner Class :static class CacheInfo
Inner Class :static class ImageReaderIterator implements Iterator<ImageReader>
Inner Class :static class CanDecodeInputFilter implements ServiceRegistry.Filter
Inner Class :static class CanEncodeImageAndFormatFilter implements ServiceRegistry.Filter
Inner Class :static class ContainsFilter implements ServiceRegistry.Filter
Inner Class :static class ImageWriterIterator implements Iterator<ImageWriter>
Inner Class :static class ImageTranscoderIterator implements Iterator<ImageTranscoder>
Inner Class :static class TranscoderFilter implements ServiceRegistry.Filter



Method Summary
public static  ImageInputStreamcreateImageInputStream(Object input)
     Returns an ImageInputStream that will take its input from the given Object.
public static  ImageOutputStreamcreateImageOutputStream(Object output)
     Returns an ImageOutputStream that will send its output to the given Object.
public static  FilegetCacheDirectory()
     Returns the current value set by setCacheDirectory, or null if no explicit setting has been made.
public static  ImageReadergetImageReader(ImageWriter writer)
     Returns an ImageReadercorresponding 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.
public static  Iterator<ImageReader>getImageReaders(Object input)
     Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the supplied Object, typically an ImageInputStream.

The stream position is left at its prior position upon exit from this method.
Parameters:
  input - an ImageInputStream or otherObject containing encoded image data.

public static  Iterator<ImageReader>getImageReadersByFormatName(String formatName)
     Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the named format.
Parameters:
  formatName - a String containing the informalname of a format (e.g., "jpeg" or "tiff".
public static  Iterator<ImageReader>getImageReadersByMIMEType(String MIMEType)
     Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given MIME type.
Parameters:
  MIMEType - a String containing a filesuffix (e.g., "image/jpeg" or "image/x-bmp").
public static  Iterator<ImageReader>getImageReadersBySuffix(String fileSuffix)
     Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given suffix.
Parameters:
  fileSuffix - a String containing a filesuffix (e.g., "jpg" or "tiff").
public static  Iterator<ImageTranscoder>getImageTranscoders(ImageReader reader, ImageWriter writer)
     Returns an Iterator containing all currently registered ImageTranscoders that claim to be able to transcode between the metadata of the given ImageReader and ImageWriter.
Parameters:
  reader - an ImageReader.
Parameters:
  writer - an ImageWriter.
public static  ImageWritergetImageWriter(ImageReader reader)
     Returns an ImageWritercorresponding 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.
public static  Iterator<ImageWriter>getImageWriters(ImageTypeSpecifier type, String formatName)
     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.
Parameters:
  type - an ImageTypeSpecifier indicating thelayout of the image to be written.
Parameters:
  formatName - the informal name of the format.
public static  Iterator<ImageWriter>getImageWritersByFormatName(String formatName)
     Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode the named format.
Parameters:
  formatName - a String containing the informalname of a format (e.g., "jpeg" or "tiff".
public static  Iterator<ImageWriter>getImageWritersByMIMEType(String MIMEType)
     Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given MIME type.
Parameters:
  MIMEType - a String containing a filesuffix (e.g., "image/jpeg" or "image/x-bmp").
public static  Iterator<ImageWriter>getImageWritersBySuffix(String fileSuffix)
     Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given suffix.
Parameters:
  fileSuffix - a String containing a filesuffix (e.g., "jpg" or "tiff").
public static  String[]getReaderFileSuffixes()
     Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered readers.
public static  String[]getReaderFormatNames()
     Returns an array of Strings listing all of the informal format names understood by the current set of registered readers.
public static  String[]getReaderMIMETypes()
     Returns an array of Strings listing all of the MIME types understood by the current set of registered readers.
public static  booleangetUseCache()
     Returns the current value set by setUseCache, or true if no explicit setting has been made.
public static  String[]getWriterFileSuffixes()
     Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered writers.
public static  String[]getWriterFormatNames()
     Returns an array of Strings listing all of the informal format names understood by the current set of registered writers.
public static  String[]getWriterMIMETypes()
     Returns an array of Strings listing all of the MIME types understood by the current set of registered writers.
public static  BufferedImageread(File input)
     Returns a BufferedImage as the result of decoding a supplied File with an ImageReader chosen automatically from among those currently registered. The File is wrapped in an ImageInputStream.
public static  BufferedImageread(InputStream input)
     Returns a BufferedImage as the result of decoding a supplied InputStream with an ImageReader chosen automatically from among those currently registered. The InputStream is wrapped in an ImageInputStream.
public static  BufferedImageread(URL input)
     Returns a BufferedImage as the result of decoding a supplied URL with an ImageReader chosen automatically from among those currently registered.
public static  BufferedImageread(ImageInputStream stream)
     Returns a BufferedImage as the result of decoding a supplied ImageInputStream with an ImageReader chosen automatically from among those currently registered.
public static  voidscanForPlugins()
     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.

This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation.

public static  voidsetCacheDirectory(File cacheDirectory)
     Sets the directory where cache files are to be created.
public static  voidsetUseCache(boolean useCache)
     Sets a flag indicating whether a disk-based cache file should be used when creating ImageInputStreams and ImageOutputStreams.

When reading from a standard InputStream>, it may be necessary to save previously read information in a cache since the underlying stream does not allow data to be re-read. Similarly, when writing to a standard OutputStream, a cache may be used to allow a previously written value to be changed before flushing it to the final destination.

The cache may reside in main memory or on disk.

public static  booleanwrite(RenderedImage im, String formatName, ImageOutputStream output)
     Writes an image using the an arbitrary ImageWriter that supports the given format to an ImageOutputStream.
public static  booleanwrite(RenderedImage im, String formatName, File output)
     Writes an image using an arbitrary ImageWriter that supports the given format to a File.
public static  booleanwrite(RenderedImage im, String formatName, OutputStream output)
     Writes an image using an arbitrary ImageWriter that supports the given format to an OutputStream.

This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream, if desired.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching.
Parameters:
  im - a RenderedImage to be written.
Parameters:
  formatName - a String containg the informalname of the format.
Parameters:
  output - an OutputStream to be written to.




Method Detail
createImageInputStream
public static ImageInputStream createImageInputStream(Object input) throws IOException(Code)
Returns an ImageInputStream that will take its input from the given Object. The set of ImageInputStreamSpis registered with the IIORegistry class is queried and the first one that is able to take input from the supplied object is used to create the returned ImageInputStream. If no suitable ImageInputStreamSpi exists, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching.
Parameters:
  input - an Object to be used as an inputsource, such as a File, readableRandomAccessFile, or InputStream. an ImageInputStream, or null.
exception:
  IllegalArgumentException - if inputis null.
exception:
  IOException - if a cache file is needed but cannot becreated.
See Also:   javax.imageio.spi.ImageInputStreamSpi




createImageOutputStream
public static ImageOutputStream createImageOutputStream(Object output) throws IOException(Code)
Returns an ImageOutputStream that will send its output to the given Object. The set of ImageOutputStreamSpis registered with the IIORegistry class is queried and the first one that is able to send output from the supplied object is used to create the returned ImageOutputStream. If no suitable ImageOutputStreamSpi exists, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching.
Parameters:
  output - an Object to be used as an outputdestination, such as a File, writableRandomAccessFile, or OutputStream. an ImageOutputStream, ornull.
exception:
  IllegalArgumentException - if output isnull.
exception:
  IOException - if a cache file is needed but cannot becreated.
See Also:   javax.imageio.spi.ImageOutputStreamSpi




getCacheDirectory
public static File getCacheDirectory()(Code)
Returns the current value set by setCacheDirectory, or null if no explicit setting has been made. a File indicating the directory wherecache files will be created, or null to indicatethe system-dependent default temporary-file directory.
See Also:   ImageIO.setCacheDirectory



getImageReader
public static ImageReader getImageReader(ImageWriter writer)(Code)
Returns an ImageReadercorresponding 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. This method is provided principally for symmetry with getImageWriter(ImageReader). Note that this method returns the "preferred" reader, which is the first in the list returned by javax.imageio.spi.ImageWriterSpi.getImageReaderSpiNames().
Parameters:
  writer - an instance of a registered ImageWriter. an ImageReader, or null.
exception:
  IllegalArgumentException - if writer isnull.
See Also:   ImageIO.getImageWriter(ImageReader)
See Also:   javax.imageio.spi.ImageWriterSpi.getImageReaderSpiNames



getImageReaders
public static Iterator<ImageReader> getImageReaders(Object input)(Code)
Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the supplied Object, typically an ImageInputStream.

The stream position is left at its prior position upon exit from this method.
Parameters:
  input - an ImageInputStream or otherObject containing encoded image data. an Iterator containing ImageReaders.
exception:
  IllegalArgumentException - if input isnull.
See Also:   javax.imageio.spi.ImageReaderSpi.canDecodeInput




getImageReadersByFormatName
public static Iterator<ImageReader> getImageReadersByFormatName(String formatName)(Code)
Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode the named format.
Parameters:
  formatName - a String containing the informalname of a format (e.g., "jpeg" or "tiff". an Iterator containingImageReaders.
exception:
  IllegalArgumentException - if formatNameis null.
See Also:   javax.imageio.spi.ImageReaderSpi.getFormatNames



getImageReadersByMIMEType
public static Iterator<ImageReader> getImageReadersByMIMEType(String MIMEType)(Code)
Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given MIME type.
Parameters:
  MIMEType - a String containing a filesuffix (e.g., "image/jpeg" or "image/x-bmp"). an Iterator containingImageReaders.
exception:
  IllegalArgumentException - if MIMEType isnull.
See Also:   javax.imageio.spi.ImageReaderSpi.getMIMETypes



getImageReadersBySuffix
public static Iterator<ImageReader> getImageReadersBySuffix(String fileSuffix)(Code)
Returns an Iterator containing all currently registered ImageReaders that claim to be able to decode files with the given suffix.
Parameters:
  fileSuffix - a String containing a filesuffix (e.g., "jpg" or "tiff"). an Iterator containingImageReaders.
exception:
  IllegalArgumentException - if fileSuffixis null.
See Also:   javax.imageio.spi.ImageReaderSpi.getFileSuffixes



getImageTranscoders
public static Iterator<ImageTranscoder> getImageTranscoders(ImageReader reader, ImageWriter writer)(Code)
Returns an Iterator containing all currently registered ImageTranscoders that claim to be able to transcode between the metadata of the given ImageReader and ImageWriter.
Parameters:
  reader - an ImageReader.
Parameters:
  writer - an ImageWriter. an Iterator containingImageTranscoders.
exception:
  IllegalArgumentException - if reader orwriter is null.



getImageWriter
public static ImageWriter getImageWriter(ImageReader reader)(Code)
Returns an ImageWritercorresponding 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. This mechanism may be used to obtain an ImageWriter that will understand the internal structure of non-pixel metadata (as encoded by IIOMetadata objects) generated by the ImageReader. By obtaining this data from the ImageReader and passing it on to the ImageWriter obtained with this method, a client program can read an image, modify it in some way, and write it back out preserving all metadata, without having to understand anything about the structure of the metadata, or even about the image format. Note that this method returns the "preferred" writer, which is the first in the list returned by javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames().
Parameters:
  reader - an instance of a registered ImageReader. an ImageWriter, or null.
exception:
  IllegalArgumentException - if reader isnull.
See Also:   ImageIO.getImageReader(ImageWriter)
See Also:   javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames



getImageWriters
public static Iterator<ImageWriter> getImageWriters(ImageTypeSpecifier type, String formatName)(Code)
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.
Parameters:
  type - an ImageTypeSpecifier indicating thelayout of the image to be written.
Parameters:
  formatName - the informal name of the format. an Iterator containing ImageWriters.
exception:
  IllegalArgumentException - if any parameter isnull.
See Also:   javax.imageio.spi.ImageWriterSpi.canEncodeImage(ImageTypeSpecifier)



getImageWritersByFormatName
public static Iterator<ImageWriter> getImageWritersByFormatName(String formatName)(Code)
Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode the named format.
Parameters:
  formatName - a String containing the informalname of a format (e.g., "jpeg" or "tiff". an Iterator containingImageWriters.
exception:
  IllegalArgumentException - if formatName isnull.
See Also:   javax.imageio.spi.ImageWriterSpi.getFormatNames



getImageWritersByMIMEType
public static Iterator<ImageWriter> getImageWritersByMIMEType(String MIMEType)(Code)
Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given MIME type.
Parameters:
  MIMEType - a String containing a filesuffix (e.g., "image/jpeg" or "image/x-bmp"). an Iterator containing ImageWriters.
exception:
  IllegalArgumentException - if MIMEType isnull.
See Also:   javax.imageio.spi.ImageWriterSpi.getMIMETypes



getImageWritersBySuffix
public static Iterator<ImageWriter> getImageWritersBySuffix(String fileSuffix)(Code)
Returns an Iterator containing all currently registered ImageWriters that claim to be able to encode files with the given suffix.
Parameters:
  fileSuffix - a String containing a filesuffix (e.g., "jpg" or "tiff"). an Iterator containing ImageWriters.
exception:
  IllegalArgumentException - if fileSuffix isnull.
See Also:   javax.imageio.spi.ImageWriterSpi.getFileSuffixes



getReaderFileSuffixes
public static String[] getReaderFileSuffixes()(Code)
Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered readers. an array of Strings.
since:
   1.6



getReaderFormatNames
public static String[] getReaderFormatNames()(Code)
Returns an array of Strings listing all of the informal format names understood by the current set of registered readers. an array of Strings.



getReaderMIMETypes
public static String[] getReaderMIMETypes()(Code)
Returns an array of Strings listing all of the MIME types understood by the current set of registered readers. an array of Strings.



getUseCache
public static boolean getUseCache()(Code)
Returns the current value set by setUseCache, or true if no explicit setting has been made. true if a disk-based cache may be used forImageInputStreams andImageOutputStreams.
See Also:   ImageIO.setUseCache



getWriterFileSuffixes
public static String[] getWriterFileSuffixes()(Code)
Returns an array of Strings listing all of the file suffixes associated with the formats understood by the current set of registered writers. an array of Strings.
since:
   1.6



getWriterFormatNames
public static String[] getWriterFormatNames()(Code)
Returns an array of Strings listing all of the informal format names understood by the current set of registered writers. an array of Strings.



getWriterMIMETypes
public static String[] getWriterMIMETypes()(Code)
Returns an array of Strings listing all of the MIME types understood by the current set of registered writers. an array of Strings.



read
public static BufferedImage read(File input) throws IOException(Code)
Returns a BufferedImage as the result of decoding a supplied File with an ImageReader chosen automatically from among those currently registered. The File is wrapped in an ImageInputStream. If no registered ImageReader claims to be able to read the resulting stream, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching in the ImageInputStream that is created.

Note that there is no read method that takes a filename as a String; use this method instead after creating a File from the filename.

This method does not attempt to locate ImageReaders that can read directly from a File; that may be accomplished using IIORegistry and ImageReaderSpi.
Parameters:
  input - a File to read from. a BufferedImage containing the decodedcontents of the input, or null.
exception:
  IllegalArgumentException - if input is null.
exception:
  IOException - if an error occurs during reading.




read
public static BufferedImage read(InputStream input) throws IOException(Code)
Returns a BufferedImage as the result of decoding a supplied InputStream with an ImageReader chosen automatically from among those currently registered. The InputStream is wrapped in an ImageInputStream. If no registered ImageReader claims to be able to read the resulting stream, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching in the ImageInputStream that is created.

This method does not attempt to locate ImageReaders that can read directly from an InputStream; that may be accomplished using IIORegistry and ImageReaderSpi.

This method does not close the provided InputStream after the read operation has completed; it is the responsibility of the caller to close the stream, if desired.
Parameters:
  input - an InputStream to read from. a BufferedImage containing the decodedcontents of the input, or null.
exception:
  IllegalArgumentException - if input is null.
exception:
  IOException - if an error occurs during reading.




read
public static BufferedImage read(URL input) throws IOException(Code)
Returns a BufferedImage as the result of decoding a supplied URL with an ImageReader chosen automatically from among those currently registered. An InputStream is obtained from the URL, which is wrapped in an ImageInputStream. If no registered ImageReader claims to be able to read the resulting stream, null is returned.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching in the ImageInputStream that is created.

This method does not attempt to locate ImageReaders that can read directly from a URL; that may be accomplished using IIORegistry and ImageReaderSpi.
Parameters:
  input - a URL to read from. a BufferedImage containing the decodedcontents of the input, or null.
exception:
  IllegalArgumentException - if input is null.
exception:
  IOException - if an error occurs during reading.




read
public static BufferedImage read(ImageInputStream stream) throws IOException(Code)
Returns a BufferedImage as the result of decoding a supplied ImageInputStream with an ImageReader chosen automatically from among those currently registered. If no registered ImageReader claims to be able to read the stream, null is returned.

Unlike most other methods in this class, this method does close the provided ImageInputStream after the read operation has completed, unless null is returned, in which case this method does not close the stream.
Parameters:
  stream - an ImageInputStream to read from. a BufferedImage containing the decodedcontents of the input, or null.
exception:
  IllegalArgumentException - if stream is null.
exception:
  IOException - if an error occurs during reading.




scanForPlugins
public static void scanForPlugins()(Code)
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.

This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.

The getResources method of the context ClassLoader is used locate JAR files containing files named META-INF/services/javax.imageio.spi.classname, where classname is one of ImageReaderSpi, ImageWriterSpi, ImageTranscoderSpi, ImageInputStreamSpi, or ImageOutputStreamSpi, along the application class path.

The contents of the located files indicate the names of actual implementation classes which implement the aforementioned service provider interfaces; the default class loader is then used to load each of these classes and to instantiate an instance of each class, which is then placed into the registry for later retrieval.

The exact set of locations searched depends on the implementation of the Java runtime enviroment.
See Also:   ClassLoader.getResources




setCacheDirectory
public static void setCacheDirectory(File cacheDirectory)(Code)
Sets the directory where cache files are to be created. A value of null indicates that the system-dependent default temporary-file directory is to be used. If getUseCache returns false, this value is ignored.
Parameters:
  cacheDirectory - a File specifying a directory.
See Also:   File.createTempFile(StringStringFile)
exception:
  SecurityException - if the security manager deniesaccess to the directory.
exception:
  IllegalArgumentException - if cacheDir isnon-null but is not a directory.
See Also:   ImageIO.getCacheDirectory



setUseCache
public static void setUseCache(boolean useCache)(Code)
Sets a flag indicating whether a disk-based cache file should be used when creating ImageInputStreams and ImageOutputStreams.

When reading from a standard InputStream>, it may be necessary to save previously read information in a cache since the underlying stream does not allow data to be re-read. Similarly, when writing to a standard OutputStream, a cache may be used to allow a previously written value to be changed before flushing it to the final destination.

The cache may reside in main memory or on disk. Setting this flag to false disallows the use of disk for future streams, which may be advantageous when working with small images, as the overhead of creating and destroying files is removed.

On startup, the value is set to true.
Parameters:
  useCache - a boolean indicating whether acache file should be used, in cases where it is optional.
See Also:   ImageIO.getUseCache




write
public static boolean write(RenderedImage im, String formatName, ImageOutputStream output) throws IOException(Code)
Writes an image using the an arbitrary ImageWriter that supports the given format to an ImageOutputStream. The image is written to the ImageOutputStream starting at the current stream pointer, overwriting existing stream data from that point forward, if present.

This method does not close the provided ImageOutputStream after the write operation has completed; it is the responsibility of the caller to close the stream, if desired.
Parameters:
  im - a RenderedImage to be written.
Parameters:
  formatName - a String containg the informalname of the format.
Parameters:
  output - an ImageOutputStream to be written to. false if no appropriate writer is found.
exception:
  IllegalArgumentException - if any parameter isnull.
exception:
  IOException - if an error occurs during writing.




write
public static boolean write(RenderedImage im, String formatName, File output) throws IOException(Code)
Writes an image using an arbitrary ImageWriter that supports the given format to a File. If there is already a File present, its contents are discarded.
Parameters:
  im - a RenderedImage to be written.
Parameters:
  formatName - a String containg the informalname of the format.
Parameters:
  output - a File to be written to. false if no appropriate writer is found.
exception:
  IllegalArgumentException - if any parameter isnull.
exception:
  IOException - if an error occurs during writing.



write
public static boolean write(RenderedImage im, String formatName, OutputStream output) throws IOException(Code)
Writes an image using an arbitrary ImageWriter that supports the given format to an OutputStream.

This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream, if desired.

The current cache settings from getUseCacheand getCacheDirectory will be used to control caching.
Parameters:
  im - a RenderedImage to be written.
Parameters:
  formatName - a String containg the informalname of the format.
Parameters:
  output - an OutputStream to be written to. false if no appropriate writer is found.
exception:
  IllegalArgumentException - if any parameter isnull.
exception:
  IOException - if an error occurs during writing.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.