Seekable, Closeable, AutoCloseablepublic final class FileSeekableStream extends SeekableInputStream
SeekableInputStream implementation that uses random access directly to a File.
FileCacheSeekableStream,
MemoryCacheSeekableStream,
RandomAccessFilemarkedPositions| Constructor | Description |
|---|---|
FileSeekableStream(File pInput) |
Creates a
FileSeekableStream that reads from the given
File. |
FileSeekableStream(RandomAccessFile pInput) |
Creates a
FileSeekableStream that reads from the given file. |
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
|
void |
closeImpl() |
|
protected void |
flushBeforeImpl(long pPosition) |
Does nothing, as we don't really do any caching here.
|
boolean |
isCached() |
Returns true if this
Seekable stream caches data itself in order
to allow seeking backwards. |
boolean |
isCachedFile() |
Returns true if this
Seekable stream caches data itself in
order to allow seeking backwards, and the cache is kept in a
temporary file. |
boolean |
isCachedMemory() |
Returns true if this
Seekable 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) |
readAllBytes, readNBytes, transferToclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckOpen, close, finalize, flush, flushBefore, getFlushedPosition, getStreamPosition, mark, mark, markSupported, read, reset, seek, skippublic FileSeekableStream(File pInput) throws FileNotFoundException
FileSeekableStream that reads from the given
File.pInput - file to read fromFileNotFoundException - if pInput does not existpublic FileSeekableStream(RandomAccessFile pInput)
FileSeekableStream that reads from the given file.
The RandomAccessFile needs only to be open in read
("r") mode.pInput - file to read frompublic boolean isCached()
SeekableSeekable 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.true if this Seekable caches data.Seekable.isCachedMemory(),
Seekable.isCachedFile()public boolean isCachedFile()
SeekableSeekable 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.true if this Seekable caches data in a
temporary file.Seekable.isCached(),
Seekable.isCachedMemory()public boolean isCachedMemory()
SeekableSeekable 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.true if this Seekable caches data in main
memory.Seekable.isCached(),
Seekable.isCachedFile()public int available()
throws IOException
available in class InputStreamIOExceptionpublic void closeImpl()
throws IOException
closeImpl in class SeekableInputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] pBytes,
int pOffset,
int pLength)
throws IOException
read in class InputStreamIOExceptionprotected void flushBeforeImpl(long pPosition)
flushBeforeImpl in class SeekableInputStreampPosition - the position to flush toSeekableInputStream.flushBefore(long)protected void seekImpl(long pPosition)
throws IOException
seekImpl in class SeekableInputStreamIOExceptionCopyright © 2018. All rights reserved.