|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.apache.batik.ext.awt.image.codec.util.SeekableStream
org.apache.batik.ext.awt.image.codec.util.ForwardSeekableStream
public class ForwardSeekableStream
A subclass of SeekableStream that may be used
to wrap a regular InputStream efficiently.
Seeking backwards is not supported.
| Field Summary |
|---|
| Fields inherited from class org.apache.batik.ext.awt.image.codec.util.SeekableStream |
|---|
markPos |
| Constructor Summary | |
|---|---|
ForwardSeekableStream(InputStream src)
Constructs a InputStreamForwardSeekableStream from a
regular InputStream. |
|
| Method Summary | |
|---|---|
int |
available()
Forwards the request to the real InputStream. |
boolean |
canSeekBackwards()
Returns false since seking backwards is not supported. |
void |
close()
Forwards the request to the real InputStream. |
long |
getFilePointer()
Returns the current position in the stream (bytes read). |
void |
mark(int readLimit)
Forwards the request to the real InputStream. |
boolean |
markSupported()
Forwards the request to the real InputStream. |
int |
read()
Forwards the request to the real InputStream. |
int |
read(byte[] b,
int off,
int len)
Forwards the request to the real InputStream. |
void |
reset()
Forwards the request to the real InputStream. |
void |
seek(long pos)
Seeks forward to the given position in the stream. |
long |
skip(long n)
Forwards the request to the real InputStream. |
| Methods inherited from class org.apache.batik.ext.awt.image.codec.util.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 |
|---|
read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForwardSeekableStream(InputStream src)
InputStreamForwardSeekableStream from a
regular InputStream.
| Method Detail |
|---|
public final int read()
throws IOException
InputStream.
read in class SeekableStream-1 if the end of the
stream is reached.
IOException - if an I/O error occurs.
public final int read(byte[] b,
int off,
int len)
throws IOException
InputStream.
read in class SeekableStreamb - 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.
IOException - if an I/O error occurs.
public final long skip(long n)
throws IOException
InputStream.
skip in class InputStreamIOException
public final int available()
throws IOException
InputStream.
available in class InputStreamIOException
public final void close()
throws IOException
InputStream.
close in interface Closeableclose in class InputStreamIOExceptionpublic final void mark(int readLimit)
InputStream.
We use SeekableStream.markPos
mark in class SeekableStream
public final void reset()
throws IOException
InputStream.
We use SeekableStream.markPos
reset in class SeekableStreamIOExceptionpublic boolean markSupported()
InputStream.
markSupported in class SeekableStreampublic final boolean canSeekBackwards()
false since seking backwards is not supported.
canSeekBackwards in class SeekableStreampublic final long getFilePointer()
getFilePointer in class SeekableStream
public final void seek(long pos)
throws IOException
pos is smaller than the current position
as returned by getFilePointer(), nothing
happens.
seek in class SeekableStreampos - the offset position, measured in bytes from the
beginning of the stream, at which to set the stream
pointer.
IOException - if pos is less than
0 or if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||