Package com.twelvemonkeys.io
Class RandomAccessStream.InputStreamView
java.lang.Object
java.io.InputStream
com.twelvemonkeys.io.SeekableInputStream
com.twelvemonkeys.io.RandomAccessStream.InputStreamView
- All Implemented Interfaces:
Seekable
,Closeable
,AutoCloseable
- Enclosing class:
RandomAccessStream
-
Field Summary
FieldsFields inherited from class com.twelvemonkeys.io.SeekableInputStream
closed, flushedPosition, markedPositions, position
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
flushBeforeImpl
(long pPosition) Discards the initial portion of the stream prior to the indicated postion.boolean
isCached()
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards.boolean
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in a temporary file.boolean
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards, and the cache is kept in main memory.int
read()
int
read
(byte[] pBytes, int pOffset, int pLength) protected void
seekImpl
(long pPosition) Methods inherited from class com.twelvemonkeys.io.SeekableInputStream
checkOpen, close, finalize, flush, flushBefore, getFlushedPosition, getStreamPosition, mark, mark, markSupported, read, reset, seek, skip
Methods inherited from class java.io.InputStream
available, nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
mStream
-
-
Constructor Details
-
InputStreamView
-
-
Method Details
-
isCached
public boolean isCached()Description copied from interface:Seekable
Returns true if thisSeekable
stream caches data itself in order to allow seeking backwards. Applications may consult this in order to decide how frequently, or whether, to flush in order to conserve cache resources.- Returns:
true
if thisSeekable
caches data.- See Also:
-
isCachedFile
public 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.- Returns:
true
if thisSeekable
caches data in a temporary file.- See Also:
-
isCachedMemory
public 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.- Returns:
true
if thisSeekable
caches data in main memory.- See Also:
-
closeImpl
- Specified by:
closeImpl
in classSeekableInputStream
- Throws:
IOException
-
flushBeforeImpl
Description copied from class:SeekableInputStream
Discards the initial portion of the stream prior to the indicated postion.- Specified by:
flushBeforeImpl
in classSeekableInputStream
- Parameters:
pPosition
- the position to flush to- Throws:
IOException
- if an I/O exception occurs during the flush operation- See Also:
-
seekImpl
- Specified by:
seekImpl
in classSeekableInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-