class ExtendedBufferedReader
extends java.io.BufferedReader
Modifier and Type | Field and Description |
---|---|
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
|
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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
|
public static final int END_OF_STREAM
public static final int UNDEFINED
private int lookaheadChar
private int lastChar
private int lineCounter
private CharBuffer line
public ExtendedBufferedReader(java.io.Reader r)
public ExtendedBufferedReader(java.io.Reader r, int bufSize)
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 toc
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