|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
edu.rice.cs.util.InputStreamRedirector
public abstract class InputStreamRedirector
Redirects requests for input through the abstract method _getInput().
| Field Summary | |
|---|---|
protected ArrayList<Character> |
_buffer
Buffer that stores the current set of bytes. |
| Constructor Summary | |
|---|---|
InputStreamRedirector()
Constructs a new InputStreamRedirector. |
|
| Method Summary | |
|---|---|
protected abstract String |
_getInput()
This method gets called whenever input is requested from the stream and nothing is currently available. |
int |
available()
|
int |
read()
Overrides the read() in PipedInputStream so that if the stream is empty, it asks for more input from _getInput(). |
int |
read(byte[] b)
Tries to fill b with bytes from the user, prompting for input only if the stream is already empty. |
int |
read(byte[] b,
int off,
int len)
Tries to fill b with bytes from the user, prompting for input only if the stream is already empty. |
| Methods inherited from class java.io.InputStream |
|---|
close, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<Character> _buffer
| Constructor Detail |
|---|
public InputStreamRedirector()
| Method Detail |
|---|
protected abstract String _getInput()
throws IOException
IOException
public int read(byte[] b)
throws IOException
read in class InputStreamb - the byte array to fill
IOException
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - the byte array to filloff - the offset in the byte arraylen - the number of characters to try to read
IOException
public int read()
throws IOException
read in class InputStreamIOException - if an I/O exceptionpublic int available()
available in class InputStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||