org.freehep.util.io
Class PromptInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.freehep.util.io.RoutedInputStream
-
- org.freehep.util.io.PromptInputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.freehep.util.io.RoutedInputStream
RoutedInputStream.Route
-
-
Constructor Summary
Constructors Constructor and Description PromptInputStream(java.io.InputStream input)Craete a Prompt input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPromptListener(java.lang.String prompt, PromptListener listener)Add a prompt listener for given prompt.-
Methods inherited from class org.freehep.util.io.RoutedInputStream
addRoute, addRoute, read
-
-
-
-
Constructor Detail
-
PromptInputStream
public PromptInputStream(java.io.InputStream input)
Craete a Prompt input stream.- Parameters:
input- stream to read
-
-
Method Detail
-
addPromptListener
public void addPromptListener(java.lang.String prompt, PromptListener listener)Add a prompt listener for given prompt.- Parameters:
prompt- prompt to listen forlistener- listener to be informed
-
-
DMelt 3.0 © DataMelt by jWork.ORG