java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.ImageOutputStreamImpl
javax.imageio.stream.MemoryCacheImageOutputStream
- All Implemented Interfaces:
- Closeable,- DataInput,- DataOutput,- AutoCloseable,- ImageInputStream,- ImageOutputStream
public class MemoryCacheImageOutputStream extends ImageOutputStreamImpl
An implementation of 
ImageOutputStream that writes its
 output to a regular OutputStream.  A memory buffer is
 used to cache at least the data between the discard position and
 the current write position.  The only constructor takes an
 OutputStream, so this class may not be used for
 read/modify/write operations.  Reading can occur only on parts of
 the stream that have already been written to the cache and not
 yet flushed.- 
Field SummaryFields declared in class javax.imageio.stream.ImageInputStreamImplbitOffset, byteOrder, flushedPos, streamPos
- 
Constructor SummaryConstructors Constructor Description MemoryCacheImageOutputStream(OutputStream stream)Constructs aMemoryCacheImageOutputStreamthat will write to a givenOutputStream.
- 
Method SummaryModifier and Type Method Description voidclose()Closes thisMemoryCacheImageOutputStream.booleanisCached()Returnstruesince thisImageOutputStreamcaches data in order to allow seeking backwards.booleanisCachedFile()Returnsfalsesince thisImageOutputStreamdoes not maintain a file cache.booleanisCachedMemory()Returnstruesince thisImageOutputStreammaintains a main memory cache.Methods declared in class javax.imageio.stream.ImageInputStreamImplcheckClosed, finalize, length, mark, read, read, read, reset, skipBytes, skipBytesMethods declared in class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javax.imageio.stream.ImageInputStreamflush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, 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, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytesMethods declared in interface javax.imageio.stream.ImageOutputStreamflushBefore, write, write, write, writeBit, writeBits, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInts, writeLong, writeLongs, writeShort, writeShorts, writeUTF
- 
Constructor Details- 
MemoryCacheImageOutputStreamConstructs aMemoryCacheImageOutputStreamthat will write to a givenOutputStream.- Parameters:
- stream- an- OutputStreamto write to.
- Throws:
- IllegalArgumentException- if- streamis- null.
 
 
- 
- 
Method Details- 
isCachedpublic boolean isCached()Returnstruesince thisImageOutputStreamcaches data in order to allow seeking backwards.- Specified by:
- isCachedin interface- ImageInputStream
- Overrides:
- isCachedin class- ImageInputStreamImpl
- Returns:
- true.
- See Also:
- isCachedMemory(),- isCachedFile()
 
- 
isCachedFilepublic boolean isCachedFile()Returnsfalsesince thisImageOutputStreamdoes not maintain a file cache.- Specified by:
- isCachedFilein interface- ImageInputStream
- Overrides:
- isCachedFilein class- ImageInputStreamImpl
- Returns:
- false.
- See Also:
- isCached(),- isCachedMemory()
 
- 
isCachedMemorypublic boolean isCachedMemory()Returnstruesince thisImageOutputStreammaintains a main memory cache.- Specified by:
- isCachedMemoryin interface- ImageInputStream
- Overrides:
- isCachedMemoryin class- ImageInputStreamImpl
- Returns:
- true.
- See Also:
- isCached(),- isCachedFile()
 
- 
closeCloses thisMemoryCacheImageOutputStream. All pending data is flushed to the output, and the cache is released. The destinationOutputStreamis not closed.- Throws:
- IOException- if an I/O error occurs.
 
 
-