|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
com.taleo.integration.client.customstep.util.csv.PeekReader
public class PeekReader
PeekReader
is a reader that reads some data in advance from the
underlying reader. It can be used when you want to know in advance what is
coming in the source of character. You must specify the number of characters
that must be read in advance to the constructor.
Field Summary | |
---|---|
protected int |
nbBuffered
The current remaining number of character that are available from the pre-read buffer. |
protected int |
posEnd
The current end position in the pre-read buffer |
protected int |
posStart
The current start position in the pre-read buffer |
protected char[] |
preReadBuffer
This is the buffer in which the pre-read characters will be stored |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
PeekReader(java.io.Reader pReader,
int pPreReadSize)
Constructs a PeekReader based on the specified reader and
the specified number of characters that must be read in advance. |
Method Summary | |
---|---|
boolean |
bufferEquals(java.lang.String pValue)
Return true if the pre-read buffer content equals the specified String. |
boolean |
bufferIsEmpty()
Return true if the pre-read buffer is empty. |
boolean |
bufferStartsWith(java.lang.String pValue)
Returns true if the characters in the pre-read buffer starts with the specified string. |
void |
close()
|
protected boolean |
isEnd()
Returns the end. |
protected void |
preRead()
Fill the pre-read buffer with the next available chars from the underlying reader. |
int |
read()
|
int |
read(char[] pCbuf,
int pOff,
int pLen)
|
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected char[] preReadBuffer
protected int posStart
protected int posEnd
protected int nbBuffered
Constructor Detail |
---|
public PeekReader(java.io.Reader pReader, int pPreReadSize)
PeekReader
based on the specified reader and
the specified number of characters that must be read in advance.
pReader
- The underlying reader from which to read the characterspPreReadSize
- The size of the pre-read bufferMethod Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
public int read(char[] pCbuf, int pOff, int pLen) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public boolean bufferStartsWith(java.lang.String pValue)
pValue
- The string that must match the start of the pre-read buffer
public boolean bufferEquals(java.lang.String pValue)
pValue
- The string that must be equals to the pre-read buffer content
public boolean bufferIsEmpty()
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
protected void preRead()
protected final boolean isEnd()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |