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

All Implemented Interfaces:
    ImageInputStream

An implementation of ImageInputStream that gets its input from a regular InputStream. A memory buffer is used to cache at least the data between the discard position and the current read position.

In general, it is preferable to use a FileCacheImageInputStream when reading from a regular InputStream. This class is provided for cases where it is not possible to create a writable temporary file.
Fields inherited from javax.imageio.stream.ImageInputStreamImpl:
byteBuf,  byteOrder,  streamPos,  bitOffset,  flushedPos
Constructor:
 public MemoryCacheImageInputStream(InputStream stream) 
    Constructs a MemoryCacheImageInputStream that will read from a given InputStream.
    Parameters:
    stream - an InputStream to read from.
    Throws:
    IllegalArgumentException - if stream is null.
    exception: IllegalArgumentException - if stream is null.
Method from javax.imageio.stream.MemoryCacheImageInputStream Summary:
close,   finalize,   flushBefore,   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.MemoryCacheImageInputStream Detail:
 public  void close() throws IOException 
    Closes this MemoryCacheImageInputStream, freeing the cache. The source InputStream is not closed.
 protected  void finalize() throws Throwable 
    {@inheritDoc}
 public  void flushBefore(long pos) throws IOException 
 public boolean isCached() 
    Returns true since this ImageInputStream caches data in order to allow seeking backwards.
 public boolean isCachedFile() 
    Returns false since this ImageInputStream does not maintain a file cache.
 public boolean isCachedMemory() 
    Returns true since this ImageInputStream maintains a main memory cache.
 public int read() throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException