M
Martin Gregorie
Is there a standard way to read single bytes from a Java program's
standard input without involving AWT or Swing?
By that I mean that I need unbuffered input: I'd like to read each
keystroke as the key is hit with it being echoed to standard output,
since I need to control whether it gets echoed or not.
I need to do within a program that's capable or running in a headless
environment and without using native code. I've looked at the standard
System streams and Console, but both are doing line buffering and neither
allows echo control (apart from Console.readPassword, and that's line
buffered).
I have a feeling I may be missing something obvious, so if its possible
to do single character, unbuffered non-echoed input from stdin, please
point me at documentation, a tutorial or some example code.
standard input without involving AWT or Swing?
By that I mean that I need unbuffered input: I'd like to read each
keystroke as the key is hit with it being echoed to standard output,
since I need to control whether it gets echoed or not.
I need to do within a program that's capable or running in a headless
environment and without using native code. I've looked at the standard
System streams and Console, but both are doing line buffering and neither
allows echo control (apart from Console.readPassword, and that's line
buffered).
I have a feeling I may be missing something obvious, so if its possible
to do single character, unbuffered non-echoed input from stdin, please
point me at documentation, a tutorial or some example code.