Package com.twelvemonkeys.io
Class MemoryCacheSeekableStream
- java.lang.Object
-
- java.io.InputStream
-
- com.twelvemonkeys.io.SeekableInputStream
-
- com.twelvemonkeys.io.AbstractCachedSeekableStream
-
- com.twelvemonkeys.io.MemoryCacheSeekableStream
-
- All Implemented Interfaces:
Seekable,java.io.Closeable,java.lang.AutoCloseable
public final class MemoryCacheSeekableStream extends AbstractCachedSeekableStream
ASeekableInputStreamimplementation that caches data in memory.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/MemoryCacheSeekableStream.java#3 $
- See Also:
FileCacheSeekableStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMemoryCacheSeekableStream.MemoryCache-
Nested classes/interfaces inherited from class com.twelvemonkeys.io.AbstractCachedSeekableStream
AbstractCachedSeekableStream.StreamCache
-
-
Field Summary
-
Fields inherited from class com.twelvemonkeys.io.AbstractCachedSeekableStream
stream, streamPosition
-
Fields inherited from class com.twelvemonkeys.io.SeekableInputStream
closed, flushedPosition, markedPositions, position
-
-
Constructor Summary
Constructors Constructor Description MemoryCacheSeekableStream(java.io.InputStream pStream)Creates aMemoryCacheSeekableStream, reading from the givenInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCachedFile()Returns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file.booleanisCachedMemory()Returns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in main memory.-
Methods inherited from class com.twelvemonkeys.io.AbstractCachedSeekableStream
available, closeImpl, flushBeforeImpl, getCache, isCached, read, read, seekImpl, syncPosition
-
Methods inherited from class com.twelvemonkeys.io.SeekableInputStream
checkOpen, close, finalize, flush, flushBefore, getFlushedPosition, getStreamPosition, mark, mark, markSupported, read, reset, seek, skip
-
-
-
-
Method Detail
-
isCachedMemory
public final boolean isCachedMemory()
Description copied from interface:SeekableReturns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in main memory. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Specified by:
isCachedMemoryin interfaceSeekable- Specified by:
isCachedMemoryin classAbstractCachedSeekableStream- Returns:
trueif thisSeekablecaches data in main memory.- See Also:
Seekable.isCached(),Seekable.isCachedFile()
-
isCachedFile
public final boolean isCachedFile()
Description copied from interface:SeekableReturns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Specified by:
isCachedFilein interfaceSeekable- Specified by:
isCachedFilein classAbstractCachedSeekableStream- Returns:
trueif thisSeekablecaches data in a temporary file.- See Also:
Seekable.isCached(),Seekable.isCachedMemory()
-
-