public class CommentReader extends Object
Reader.markSupported() must return true). A line is considered commented if it starts
with one of the configured comment indicators.| Constructor and Description |
|---|
CommentReader(Reader in,
String[] comments)
Constructs a new CommentReader.
|
CommentReader(Reader in,
String[] comments,
Character recordTerminator)
Constructs a new CommentReader.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEOF()
Returns whether the end of the stream was reached reading a commented line.
|
boolean |
isSkipLF()
Returns whether the next character should be ignored if its a line feed.
|
int |
skipComments(boolean initialSkipLF)
Skips comments in the input stream and returns the number of commented lines read.
|
public CommentReader(Reader in, String[] comments) throws IllegalArgumentException
in - the input stream to readcomments - an array of comment identifying stringsIllegalArgumentException - if the configured comments are invalid or the reader does
not support markingpublic CommentReader(Reader in, String[] comments, Character recordTerminator) throws IllegalArgumentException
in - the input stream to read fromcomments - an array of comment identifying stringsrecordTerminator - the record terminating characterIllegalArgumentException - if the configured comments are invalid or the reader does
not support markingpublic boolean isSkipLF()
public boolean isEOF()
public int skipComments(boolean initialSkipLF)
throws IOException
initialSkipLF - true if the first line feed character read should be ignoredIOException