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
ASeekableInputStream
implementation 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 class
MemoryCacheSeekableStream.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 boolean
isCachedFile()
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file.boolean
isCachedMemory()
Returns true if thisSeekable
stream 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:Seekable
Returns true if thisSeekable
stream 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:
isCachedMemory
in interfaceSeekable
- Specified by:
isCachedMemory
in classAbstractCachedSeekableStream
- Returns:
true
if thisSeekable
caches data in main memory.- See Also:
Seekable.isCached()
,Seekable.isCachedFile()
-
isCachedFile
public final boolean isCachedFile()
Description copied from interface:Seekable
Returns true if thisSeekable
stream 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:
isCachedFile
in interfaceSeekable
- Specified by:
isCachedFile
in classAbstractCachedSeekableStream
- Returns:
true
if thisSeekable
caches data in a temporary file.- See Also:
Seekable.isCached()
,Seekable.isCachedMemory()
-
-