|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.sun.media.jai.codec.SeekableStream | +--com.sun.media.jai.codec.FileSeekableStream
A subclass of SeekableStream
that takes its input
from a File
or RandomAccessFile
.
Backwards seeking is supported. The mark()
and
resest()
methods are supported.
This class is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.
Fields inherited from class com.sun.media.jai.codec.SeekableStream |
markPos |
Constructor Summary | |
FileSeekableStream(File file)
Constructs a FileSeekableStream from a
File . |
|
FileSeekableStream(RandomAccessFile file)
Constructs a FileSeekableStream from a
RandomAccessFile . |
|
FileSeekableStream(String name)
Constructs a FileSeekableStream from a
String path name. |
Method Summary | |
boolean |
canSeekBackwards()
Returns true since seeking backwards is supported. |
void |
close()
Forwards the request to the real File . |
long |
getFilePointer()
Returns the current offset in this stream. |
void |
mark(int readLimit)
Marks the current file position for later return using the reset() method. |
boolean |
markSupported()
Returns true since marking is supported. |
int |
read()
Forwards the request to the real File . |
int |
read(byte[] b,
int off,
int len)
Forwards the request to the real File . |
void |
reset()
Returns the file position to its position at the time of the immediately previous call to the mark()
method. |
void |
seek(long pos)
Sets the offset, measured from the beginning of this stream, at which the next read occurs. |
int |
skip(int n)
|
Methods inherited from class com.sun.media.jai.codec.SeekableStream |
finalize,
readBoolean,
readByte,
readChar,
readCharLE,
readDouble,
readDoubleLE,
readFloat,
readFloatLE,
readFully,
readFully,
readInt,
readIntLE,
readLine,
readLong,
readLongLE,
readShort,
readShortLE,
readUnsignedByte,
readUnsignedInt,
readUnsignedIntLE,
readUnsignedShort,
readUnsignedShortLE,
readUTF,
skipBytes,
wrapInputStream |
Methods inherited from class java.io.InputStream |
available,
read,
skip |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FileSeekableStream(RandomAccessFile file) throws IOException
FileSeekableStream
from a
RandomAccessFile
.public FileSeekableStream(File file) throws IOException
FileSeekableStream
from a
File
.public FileSeekableStream(String name) throws IOException
FileSeekableStream
from a
String
path name.Method Detail |
public final boolean canSeekBackwards()
public final long getFilePointer() throws IOException
public final void seek(long pos) throws IOException
If canSeekBackwards()
returns false
,
then setting pos
to an offset smaller than
the current value of getFilePointer()
will have
no effect.
pos
- the offset position, measured in bytes from the
beginning of the stream, at which to set the stream
pointer.pos
is less than
0
or if an I/O error occurs.public final int skip(int n) throws IOException
public final int read() throws IOException
File
.-1
if the end of the
stream is reached.public final int read(byte[] b, int off, int len) throws IOException
File
.b
- the buffer into which the data is read.off
- the start offset in array b
at which the data is written.len
- the maximum number of bytes to read.-1
if there is no more data because the end of
the stream has been reached.public final void close() throws IOException
File
.public final void mark(int readLimit)
reset()
method.public final void reset() throws IOException
mark()
method.public boolean markSupported()
true
since marking is supported.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |