org.adougou.cline
Class TextAreaInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.adougou.cline.TextAreaInputStream

public class TextAreaInputStream
extends java.io.InputStream

This is an InputStream that can be assigned to System.in. It is used by the TextAreaPrompt (but could also be used for other purposes).

See Also:
TextArea, TextAreaPrompt, TextAreaOutputStream

Method Summary
 int available()
           
 int read()
          Read a single byte from the TextArea.
 int read(byte[] b, int start, int bLength)
          Read an array of bytes.
 
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
 

Method Detail

available

public int available()
Overrides:
available in class java.io.InputStream
Returns:
the number of bytes available to be read.

read

public int read(byte[] b,
                int start,
                int bLength)
         throws java.io.IOException
Read an array of bytes. This method will be called by methods such as BufferedReader.readLine() - for example in BasePrompt.
Overrides:
read in class java.io.InputStream
Returns:
the number of bytes that were read.

read

public int read()
         throws java.io.IOException
Read a single byte from the TextArea. This method makes use of the read(byte[], int, int) method which is much more efficient for reading more than one byte at a time.
Overrides:
read in class java.io.InputStream