Class CharacterDevice

  • All Implemented Interfaces:
    Console, Flushable

    public class CharacterDevice
    extends Object
    implements Console
    Console which is based on provided readers and writers.
    • Method Detail

      • reader

        public Reader reader()
        Gets the Reader associated with the console. Invoking close() on this object will not close the underlying stream.
        Specified by:
        reader in interface Console
        Returns:
        the reader
        See Also:
        Console.reader()
      • readPassword

        public char[] readPassword​(String fmt,
                                   Object... args)
        Writes formatted prompt and reads password. Hidden input should be preferred if possible. Implementations which cannot hide input should display a warning that entered text will be visible.
        Specified by:
        readPassword in interface Console
        Parameters:
        fmt - format String
        args - arguments to replace format specifiers in format String
        Returns:
        the password
        See Also:
        Console.readPassword(String, Object...)
      • readPassword

        public char[] readPassword()
        Reads password. Hidden input should be preferred if possible. Implementations which cannot hide input should display a warning that entered text will be visible.
        Specified by:
        readPassword in interface Console
        Returns:
        the password
        See Also:
        Console.readPassword()
      • flush

        public void flush()
        Specified by:
        flush in interface Flushable