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

All Implemented Interfaces:
    ImageOutputStream, ImageInputStream

An implementation of ImageOutputStream that writes its output to a regular OutputStream. A file is used to cache data until it is flushed to the output stream.
Fields inherited from javax.imageio.stream.ImageInputStreamImpl:
byteBuf,  byteOrder,  streamPos,  bitOffset,  flushedPos
Constructor:
 public FileCacheImageOutputStream(OutputStream stream,
    File cacheDir) throws IOException 
    Constructs a FileCacheImageOutputStream that will write to a given outputStream.

    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 OutputStream to write to.
    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.FileCacheImageOutputStream Summary:
close,   flushBefore,   isCached,   isCachedFile,   isCachedMemory,   length,   read,   read,   seek,   write,   write
Methods from javax.imageio.stream.ImageOutputStreamImpl:
flushBits,   write,   write,   write,   writeBit,   writeBits,   writeBoolean,   writeByte,   writeBytes,   writeChar,   writeChars,   writeChars,   writeDouble,   writeDoubles,   writeFloat,   writeFloats,   writeInt,   writeInts,   writeLong,   writeLongs,   writeShort,   writeShorts,   writeUTF
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.FileCacheImageOutputStream Detail:
 public  void close() throws IOException 
    Closes this FileCacheImageOututStream. All pending data is flushed to the output, and the cache file is closed and removed. The destination OutputStream is not closed.
 public  void flushBefore(long pos) throws IOException 
 public boolean isCached() 
    Returns true since this ImageOutputStream caches data in order to allow seeking backwards.
 public boolean isCachedFile() 
    Returns true since this ImageOutputStream maintains a file cache.
 public boolean isCachedMemory() 
    Returns false since this ImageOutputStream does not maintain a main memory cache.
 public long length() 
 public int read() throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException 
 public  void seek(long pos) throws IOException 
    Sets the current stream position and resets the bit offset to 0. It is legal to seek past the end of the file; an EOFException will be thrown only if a read is performed. The file length will not be increased until a write is performed.
 public  void write(int b) throws IOException 
 public  void write(byte[] b,
    int off,
    int len) throws IOException