java.lang.Object
java.io.Reader
java.io.FilterReader
com.go.trove.io.PositionReader
- Direct Known Subclasses:
- EscapeReader, LinePositionReader, PushbackPositionReader
- public class PositionReader
- extends java.io.FilterReader
The PositionReader tracks the postion in the stream of the next character
to be read. PositionReaders chain together such that the position is
read from the earliest PositionReader in the chain.
Position readers automatically close the underlying input stream when
the end of file is reached. Ordinary input streams don't do this.
- Version:
- 15 , 12/11/00
|
Method Summary |
void |
close()
This method closes the stream by calling the close() method
of the underlying stream. |
int |
getNextPosition()
|
int |
read()
Calls the in.read() method |
int |
read(char[] buf,
int off,
int length)
Calls the in.read(char[], int, int) method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mPosReader
protected PositionReader mPosReader
- Is non-null when this PositionReader is chained to another.
mPosition
protected int mPosition
mClosed
private boolean mClosed
PositionReader
public PositionReader(java.io.Reader reader)
getNextPosition
public int getNextPosition()
read
public int read()
throws java.io.IOException
- Description copied from class:
java.io.FilterReader
- Calls the
in.read() method
read
public int read(char[] buf,
int off,
int length)
throws java.io.IOException
- Description copied from class:
java.io.FilterReader
- Calls the
in.read(char[], int, int) method.
close
public void close()
throws java.io.IOException
- Description copied from class:
java.io.FilterReader
- This method closes the stream by calling the
close() method
of the underlying stream.