Java: use NIO with System.in [duplicate]
This question already has answers here : How to get SelectableChannel from an InputStream? (2 answers) Closed 3 years ago . Is it possible to use NIO with System.in? I would like to somehow treat 'stdin' as a selectable channel. Has anyone found a way to do this? Jason S duplicate: How to get SelectableChannel from an InputStream? hmmm... on second thought, for stdin there may be a solution. I found this reference: http://www.javafaq.nu/java-example-code-346.html and in particular: SystemInPipe.java (class which encapsulates stdin as a selectable channel) I don't know about a SelectableChannel