Save This Page
Home » openjdk-7 » javax » imageio » stream » [javadoc | source]
javax.imageio.stream
public class: FileCacheImageInputStream [javadoc | source]
java.lang.Object
   javax.imageio.stream.ImageInputStreamImpl
      javax.imageio.stream.FileCacheImageInputStream

All Implemented Interfaces:
    ImageInputStream

An implementation of ImageInputStream that gets its input from a regular InputStream. A file is used to cache previously read data.
Fields inherited from javax.imageio.stream.ImageInputStreamImpl:
byteBuf,  byteOrder,  streamPos,  bitOffset,  flushedPos
Constructor:
 public FileCacheImageInputStream(InputStream stream,
    File cacheDir) throws IOException 
    Constructs a FileCacheImageInputStream that will read from a given InputStream.

    A temporary file is used as a cache. If cacheDiris non-null and is a directory, the file will be created there. If it is null, the system-dependent default temporary-file directory will be used (see the documentation for File.createTempFile for details).

    Parameters:
    stream - an InputStream to read from.
    cacheDir - a File indicating where the cache file should be created, or null to use the system directory.
    Throws:
    IllegalArgumentException - if stream is null.
    IllegalArgumentException - if cacheDir is non-null but is not a directory.
    IOException - if a cache file cannot be created.
    exception: IllegalArgumentException - if stream is null.
    exception: IllegalArgumentException - if cacheDir is non-null but is not a directory.
    exception: IOException - if a cache file cannot be created.
Method from javax.imageio.stream.FileCacheImageInputStream Summary:
close,   finalize,   isCached,   isCachedFile,   isCachedMemory,   read,   read
Methods from javax.imageio.stream.ImageInputStreamImpl:
checkClosed,   close,   finalize,   flush,   flushBefore,   getBitOffset,   getByteOrder,   getFlushedPosition,   getStreamPosition,   isCached,   isCachedFile,   isCachedMemory,   length,   mark,   read,   read,   read,   readBit,   readBits,   readBoolean,   readByte,   readBytes,   readChar,   readDouble,   readFloat,   readFully,   readFully,   readFully,   readFully,   readFully,   readFully,   readFully,   readFully,   readInt,   readLine,   readLong,   readShort,   readUTF,   readUnsignedByte,   readUnsignedInt,   readUnsignedShort,   reset,   seek,   setBitOffset,   setByteOrder,   skipBytes,   skipBytes
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.imageio.stream.FileCacheImageInputStream Detail:
 public  void close() throws IOException 
    Closes this FileCacheImageInputStream, closing and removing the cache file. The source InputStream is not closed.
 protected  void finalize() throws Throwable 
    {@inheritDoc}
 public boolean isCached() 
    Returns true since this ImageInputStream caches data in order to allow seeking backwards.
 public boolean isCachedFile() 
    Returns true since this ImageInputStream maintains a file cache.
 public boolean isCachedMemory() 
    Returns false since this ImageInputStream does not maintain a main memory cache.
 public int read() throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException