|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectolg.csv.base.csv.CharSearchReader
public class CharSearchReader
This class provides methods based on the character search and hides the original stream reading.
Field Summary | |
---|---|
static int |
BUF_SIZE
Reader Buffer size default size. |
Constructor Summary | |
---|---|
|
CharSearchReader(InputStream reader,
String charset)
|
protected |
CharSearchReader(InputStream reader,
String charset,
int bufSize)
|
Method Summary | |
---|---|
char |
charAt(int index)
Returns the char at an index. |
void |
close()
|
boolean |
exists(int index)
Indicates if a char exists at an index in this stream. |
int |
find(char... args)
Finds the first index of the first character found. |
int |
findNextAtIndex(int begin,
char... args)
Finds the first index of the first character found starting at a specific index in the stream. |
int |
getSize()
Returns the current size of the stream. |
boolean |
isEof()
Indicates if end of file is reached. |
void |
skip(int nb)
Skips characters in the stream. |
String |
substring(int begin,
int end)
Returns a new String that contains a subsequence of characters currently contained in the stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUF_SIZE
Constructor Detail |
---|
public CharSearchReader(InputStream reader, String charset) throws IOException
reader
- the input stream.charset
- the charset name.
IOException
- If an I/O error occurs or If the named charset is not
supportedprotected CharSearchReader(InputStream reader, String charset, int bufSize) throws IOException
reader
- the input stream.charset
- the charset name.bufSize
- the max buf size.
IOException
- If an I/O error occurs or If the named charset is not
supportedMethod Detail |
---|
public boolean isEof()
public char charAt(int index) throws IOException
index
- the index.
IOException
- when the index is not reachable or If an I/O error occurspublic boolean exists(int index)
index
- the index
public int find(char... args) throws IOException
args
- the chars to search.
IOException
- the eof is reached without find chars or if an I/O error
occurs.public int findNextAtIndex(int begin, char... args) throws IOException
begin
- the index to start the search from.args
- the chars to search.
IOException
- when the begin index is not reachable or the eof is reached
without find chars.public void skip(int nb)
nb
- The number of characters to skippublic String substring(int begin, int end)
begin
- The beginning index, inclusive.end
- The ending index, exclusive.
public int getSize()
public void close()
close
in interface Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |