au.com.lastweekend.jen.util
Class LineGobbler

java.lang.Object
  extended by 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

Constructor Summary
LineGobbler(java.io.BufferedReader reader)
           
LineGobbler(java.io.InputStream is)
           
LineGobbler(java.io.Reader reader)
           
 
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
 

Constructor Detail

LineGobbler

public LineGobbler(java.io.InputStream is)

LineGobbler

public LineGobbler(java.io.Reader reader)

LineGobbler

public LineGobbler(java.io.BufferedReader reader)
Method Detail

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.