jline
Class ConsoleReaderInputStream
java.lang.Object
java.io.InputStream
jline.ConsoleReaderInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class ConsoleReaderInputStream
- extends java.io.InputStream
An InputStream implementation that wraps a ConsoleReader.
It is useful for setting up the System.in for a generic
console.
- Author:
- Marc Prud'hommeaux
| Methods inherited from class java.io.InputStream |
close, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConsoleReaderInputStream
public ConsoleReaderInputStream(ConsoleReader reader)
setIn
public static void setIn()
throws java.io.IOException
- Throws:
java.io.IOException
setIn
public static void setIn(ConsoleReader reader)
restoreIn
public static void restoreIn()
- Restore the original
System.in input stream.
available
public int available()
throws java.io.IOException
- Overrides:
available in class java.io.InputStream
- Throws:
java.io.IOException- See Also:
InputStream.available()
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
java.io.IOException- See Also:
InputStream.read()
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
java.io.IOException- See Also:
InputStream.read(byte[], int, int)
setPrompt
public void setPrompt(java.lang.String prompt)
- Sets the prompt for this input stream. This can be changed at any point
and the prompt for subsequent lines will reflect the change.
- Parameters:
p - the new prompt
Copyright © 2002-2007 Open World Ltd. All Rights Reserved.