org.freehep.util.io
Class PromptInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.freehep.util.io.DecodingInputStream
          extended by org.freehep.util.io.RoutedInputStream
              extended by org.freehep.util.io.PromptInputStream
All Implemented Interfaces:
Closeable

public class PromptInputStream
extends RoutedInputStream

The PromptInputStream reads from an inputstream until it reads any prompt for which a listener is added. The listener is informed that the prompt is found. The route which contains the prompt is supplied as a parameter to the listener. Returning from the prompt listener without reading the route to its end will allow the main stream to read it. The implementation of this class is based on the RoutedInputStream.

Version:
$Id: src/main/java/org/freehep/util/io/PromptInputStream.java 96b41b903496 2005/11/21 19:50:18 duns $
Author:
Mark Donszelmann

Nested Class Summary
 
Nested classes/interfaces inherited from class org.freehep.util.io.RoutedInputStream
RoutedInputStream.Route
 
Constructor Summary
PromptInputStream(InputStream input)
          Craete a Prompt input stream.
 
Method Summary
 void addPromptListener(String prompt, PromptListener listener)
          Add a prompt listener for given prompt.
 
Methods inherited from class org.freehep.util.io.RoutedInputStream
addRoute, addRoute, read
 
Methods inherited from class org.freehep.util.io.DecodingInputStream
read
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PromptInputStream

public PromptInputStream(InputStream input)
Craete a Prompt input stream.

Parameters:
input - stream to read
Method Detail

addPromptListener

public void addPromptListener(String prompt,
                              PromptListener listener)
Add a prompt listener for given prompt.

Parameters:
prompt - prompt to listen for
listener - listener to be informed


Copyright © 2012. All Rights Reserved.