javax.imageio.stream
Class FileCacheImageOutputStream

java.lang.Object
  |
  +--javax.imageio.stream.ImageInputStreamImpl
        |
        +--javax.imageio.stream.ImageOutputStreamImpl
              |
              +--javax.imageio.stream.FileCacheImageOutputStream
All Implemented Interfaces:
DataInput, DataOutput, ImageInputStream, ImageOutputStream
public class FileCacheImageOutputStream
extends ImageOutputStreamImpl

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.

 

Field Summary

 
Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
 

 

Constructor Summary

FileCacheImageOutputStream(OutputStream stream, File cacheDir)
    Constructs a FileCacheImageOutputStream that will write to a given outputStream.
 

 

Method Summary

 void close()
    Closes this FileCacheImageOututStream.
 void flushBefore(long pos)
    Flushes all data prior to the given position to the underlying destination, such as an OutputStream or File.
 boolean isCached()
    Returns true since this ImageOutputStream caches data in order to allow seeking backwards.
 boolean isCachedFile()
    Returns true since this ImageOutputStream maintains a file cache.
 boolean isCachedMemory()
    Returns false since this ImageOutputStream does not maintain a main memory cache.
 long length()
    Returns the total length of the stream, if known.
 int read()
    Reads a single byte from the stream and returns it as an integer between 0 and 255.
 int read(byte[] b, int off, int len)
    Reads up to len bytes from the stream, and stores them into b starting at index off.
 void seek(long pos)
    Sets the current stream position and resets the bit offset to 0.
 void write(byte[] b, int off, int len)
    Writes a sequence of bytes to the stream at the current position.
 void write(int b)
    Writes a single byte to the stream at the current position.
 
Methods inherited from class javax.imageio.stream.ImageOutputStreamImpl