Class CharReader


  • public class CharReader
    extends Object
    A keystroke char reader. returns a Char object at a time related to the single keystroke the user typed. Note that since this does not implement the Reader base class, it does not belong in the 'io' package.
    • Constructor Detail

      • CharReader

        public CharReader​(Reader in)
    • Method Detail

      • readIfAvailable

        public Char readIfAvailable()
                             throws IOException
        Read a single char if ready (something is available in the input stream), otherwise return null.
        Returns:
        The read char or null of not ready.
        Throws:
        IOException - If failed to read from input.
      • read

        public Char read()
                  throws IOException
        Read the next char.
        Returns:
        The next char, or null of input stream is closed.
        Throws:
        IOException - If unable to read a char.