fc.io
Class CommentedFileReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
fc.io.CommentedFileReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class CommentedFileReader
- extends java.io.BufferedReader
Extends the readLine
functionality of BufferedReader
by ignoring any commented and empty lines.
- comments start with
#
or //
- empty lines consist of only 0 or more whitespace
Method Summary |
static void |
main(java.lang.String[] args)
|
java.lang.String |
readLine()
|
Methods inherited from class java.io.BufferedReader |
close, mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.io.Reader |
read, read |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommentedFileReader
public CommentedFileReader(java.io.Reader r)
throws java.io.IOException
- Reads from the specified Reader
- Throws:
java.io.IOException
- on error reading from the file
CommentedFileReader
public CommentedFileReader(java.io.File f)
throws java.io.IOException
- Reads from the specified file, using UTF-8 encoding.
- Throws:
java.io.IOException
- on error reading from the file
readLine
public java.lang.String readLine()
throws java.io.IOException
- Overrides:
readLine
in class java.io.BufferedReader
- Throws:
java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException