Package de.audioattack.io
Class CharacterDevice
java.lang.Object
de.audioattack.io.CharacterDevice
Console which is based on provided readers and writers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Writes formatted String.Convenience method which writes formatted String.reader()Gets aReaderassociated with the console.readLine()Reads single line.Writes formatted prompt and reads single line.char[]Reads password.char[]readPassword(String fmt, Object... args) Writes formatted prompt and reads password.writer()Gets aPrintWriterassociated with the console.
-
Method Details
-
reader
Gets aReaderassociated with the console. Invokingclose()on this object will not close the underlying stream. -
writer
Gets aPrintWriterassociated with the console. Invokingclose()on this object will not close the underlying stream. -
format
Writes formatted String. -
printf
Convenience method which writes formatted String. -
readLine
Writes formatted prompt and reads single line. -
readLine
Reads single line. -
readPassword
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:
readPasswordin interfaceConsole- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the password
- See Also:
-
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:
readPasswordin interfaceConsole- Returns:
- the password
- See Also:
-
flush
public void flush()
-