|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
java.io.BufferedReader
org.apache.commons.csv.ExtendedBufferedReader
class ExtendedBufferedReader
ExtendedBufferedReader A special reader decorater which supports more sophisticated access to the underlying reader object. In particular the reader supports a look-ahead option, which allows you to see the next char returned by next(). Furthermore the skip-method supports skipping until (but excluding) a given char. Similar functionality is supported by the reader as well.
Field Summary | |
---|---|
static int |
END_OF_STREAM
the end of stream symbol |
private int |
lastChar
the last char returned |
private CharBuffer |
line
|
private int |
lineCounter
the line counter |
private int |
lookaheadChar
the lookahead chars |
static int |
UNDEFINED
undefined state for the lookahead char |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
ExtendedBufferedReader(java.io.Reader r)
Created extended buffered reader using default buffer-size |
|
ExtendedBufferedReader(java.io.Reader r,
int bufSize)
Create extended buffered reader using the given buffer-size |
Method Summary | |
---|---|
int |
getLineNumber()
Returns the nof line read ATTENTION: the skip-method does invalidate the line-number counter |
int |
lookAhead()
Returns the next char in the stream without consuming it. |
boolean |
markSupported()
|
int |
read()
Reads the next char from the input stream. |
int |
read(char[] buf,
int off,
int len)
Non-blocking reading of len chars into buffer buf starting at bufferposition off. |
int |
readAgain()
Returns the last read character again. |
java.lang.String |
readLine()
|
java.lang.String |
readUntil(char c)
Reads all characters up to (but not including) the given character. |
long |
skip(long n)
Skips char in the stream ATTENTION: invalidates the line-counter !!!!! |
long |
skipUntil(char c)
Skips all chars in the input until (but excluding) the given char |
Methods inherited from class java.io.BufferedReader |
---|
close, mark, ready, reset |
Methods inherited from class java.io.Reader |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int END_OF_STREAM
public static final int UNDEFINED
private int lookaheadChar
private int lastChar
private int lineCounter
private CharBuffer line
Constructor Detail |
---|
public ExtendedBufferedReader(java.io.Reader r)
public ExtendedBufferedReader(java.io.Reader r, int bufSize)
Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.BufferedReader
java.io.IOException
public int readAgain()
public int read(char[] buf, int off, int len) throws java.io.IOException
read
in class java.io.BufferedReader
java.io.IOException
public java.lang.String readUntil(char c) throws java.io.IOException
c
- the character to read up to
c
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
readLine
in class java.io.BufferedReader
java.io.IOException
public long skip(long n) throws java.lang.IllegalArgumentException, java.io.IOException
skip
in class java.io.BufferedReader
java.lang.IllegalArgumentException
java.io.IOException
public long skipUntil(char c) throws java.lang.IllegalArgumentException, java.io.IOException
c
-
java.lang.IllegalArgumentException
java.io.IOException
public int lookAhead() throws java.io.IOException
java.io.IOException
public int getLineNumber()
public boolean markSupported()
markSupported
in class java.io.BufferedReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |