net.sf.sfac.file
Class LineReader
java.lang.Object
net.sf.sfac.file.LineReader
- Direct Known Subclasses:
- LineReaderFilteringHtml
public class LineReader
- extends Object
Object wrapping a BufferedReader adding line peeking and counting.
It can:
- Peek line (=getting content of next line without getting it out).
- Count lines.
- Remind the source name (file name, resource name, url)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineReader
public LineReader(File src)
throws IOException
- Throws:
IOException
LineReader
public LineReader(URL src)
throws IOException
- Throws:
IOException
LineReader
public LineReader(Class<?> loader,
String resourceName)
throws IOException
- Throws:
IOException
LineReader
public LineReader(BufferedReader reader)
throws IOException
- Throws:
IOException
getReaderEncoding
public static String getReaderEncoding()
setReaderEncoding
public static void setReaderEncoding(String newReaderEncoding)
peekLine
public String peekLine()
throws IOException
- Throws:
IOException
peekNextLine
public String peekNextLine()
throws IOException
- Equivalent to calling
readLine() and then peekLine().
- Throws:
IOException
readLine
public String readLine()
throws IOException
- Throws:
IOException
readLineImpl
protected String readLineImpl()
throws IOException
- Throws:
IOException
getSourceName
public String getSourceName()
getLineIndex
public int getLineIndex()
- Returns the index of the line returned if you currently call the peekLine() method.
close
public void close()
throws IOException
- Throws:
IOException
Copyright © 2012. All Rights Reserved.