|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
com.twelvemonkeys.io.SeekableInputStream
com.twelvemonkeys.io.FileSeekableStream
public final class FileSeekableStream
A SeekableInputStream implementation that uses random access directly to a File.
FileCacheSeekableStream,
MemoryCacheSeekableStream,
RandomAccessFile| Field Summary |
|---|
| Fields inherited from class com.twelvemonkeys.io.SeekableInputStream |
|---|
markedPositions |
| Constructor Summary | |
|---|---|
FileSeekableStream(File pInput)
Creates a FileSeekableStream that reads from the given
File. |
|
FileSeekableStream(RandomAccessFile pInput)
Creates a FileSeekableStream that reads from the given file. |
|
| Method Summary | |
|---|---|
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)
|
| 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.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSeekableStream(File pInput)
throws FileNotFoundException
FileSeekableStream that reads from the given
File.
pInput - file to read from
FileNotFoundException - 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 from| Method Detail |
|---|
public 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 InputStreamIOException
public void closeImpl()
throws IOException
closeImpl in class SeekableInputStreamIOException
public int read()
throws IOException
read in class InputStreamIOException
public 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 SeekableInputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||