Class MemoryCacheSeekableStream

All Implemented Interfaces:
Seekable, Closeable, AutoCloseable

public final class MemoryCacheSeekableStream extends AbstractCachedSeekableStream
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:
  • Constructor Details

    • MemoryCacheSeekableStream

      public MemoryCacheSeekableStream(InputStream pStream)
      Creates a MemoryCacheSeekableStream, reading from the given InputStream. Data will be cached in memory.
      Parameters:
      pStream - the InputStream to read from.
  • Method Details

    • isCachedMemory

      public final boolean isCachedMemory()
      Description copied from interface: Seekable
      Returns true if this Seekable 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 interface Seekable
      Specified by:
      isCachedMemory in class AbstractCachedSeekableStream
      Returns:
      true if this Seekable caches data in main memory.
      See Also:
    • isCachedFile

      public final boolean isCachedFile()
      Description copied from interface: Seekable
      Returns true if this Seekable 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 interface Seekable
      Specified by:
      isCachedFile in class AbstractCachedSeekableStream
      Returns:
      true if this Seekable caches data in a temporary file.
      See Also: