au.com.lastweekend.jen.util
Class LineGobbler
java.lang.Object
au.com.lastweekend.jen.util.LineGobbler
- All Implemented Interfaces:
- java.lang.Runnable
public abstract class LineGobbler
- extends java.lang.Object
- implements java.lang.Runnable
Runnable that eats lines from an InputStream or Reader
Internally uses a BufferedReader to get lines from the input stream.
- Author:
- ggardner
|
Method Summary |
protected abstract void |
gobble(java.lang.String line)
Do something with the line of input |
protected void |
handleReaderException(java.io.IOException e)
BufferedReader throws IOException. |
void |
run()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineGobbler
public LineGobbler(java.io.InputStream is)
LineGobbler
public LineGobbler(java.io.Reader reader)
LineGobbler
public LineGobbler(java.io.BufferedReader reader)
run
public final void run()
- Specified by:
run in interface java.lang.Runnable
gobble
protected abstract void gobble(java.lang.String line)
- Do something with the line of input
- Parameters:
line -
handleReaderException
protected void handleReaderException(java.io.IOException e)
- BufferedReader throws IOException. Override this method
if you want to do something other than wrap it in a run-time exception.
- Parameters:
e -
Copyright © 2008. All Rights Reserved.