Class MemoryCacheSeekableStream
java.lang.Object
java.io.InputStream
com.twelvemonkeys.io.SeekableInputStream
com.twelvemonkeys.io.AbstractCachedSeekableStream
com.twelvemonkeys.io.MemoryCacheSeekableStream
- All Implemented Interfaces:
Seekable, Closeable, AutoCloseable
A
SeekableInputStream 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classNested classes/interfaces inherited from class AbstractCachedSeekableStream
AbstractCachedSeekableStream.StreamCache -
Field Summary
Fields inherited from class AbstractCachedSeekableStream
stream, streamPositionFields inherited from class SeekableInputStream
closed, flushedPosition, markedPositions, position -
Constructor Summary
ConstructorsConstructorDescriptionMemoryCacheSeekableStream(InputStream pStream) Creates aMemoryCacheSeekableStream, reading from the givenInputStream. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file.final booleanReturns true if thisSeekablestream caches data itself in order to allow seeking backwards, and the cache is kept in main memory.Methods inherited from class AbstractCachedSeekableStream
available, closeImpl, flushBeforeImpl, getCache, isCached, read, read, seekImpl, syncPositionMethods inherited from class SeekableInputStream
checkOpen, close, finalize, flush, flushBefore, getFlushedPosition, getStreamPosition, mark, mark, markSupported, read, reset, seek, skipMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
MemoryCacheSeekableStream
Creates aMemoryCacheSeekableStream, reading from the givenInputStream. Data will be cached in memory.- Parameters:
pStream- theInputStreamto read from.
-
-
Method Details
-
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:
-
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:
-