SystemInPipepublic class SystemInPipe extends Object Class which encapsulates System.in as a selectable channel.
Instantiate this class, call start() on it to run the background
draining thread, then call getStdinChannel() to get a SelectableChannel
object which can be used with a Selector object. |
Fields Summary |
---|
Pipe | pipe | CopyThread | copyThread |
Constructors Summary |
---|
public SystemInPipe(InputStream in)
pipe = Pipe.open();
copyThread = new CopyThread (in, pipe.sink());
| public SystemInPipe()
this (System.in);
|
Methods Summary |
---|
protected void | finalize()
copyThread.shutdown();
| public java.nio.channels.SelectableChannel | getStdinChannel()
SelectableChannel channel = pipe.source();
channel.configureBlocking (false);
return (channel);
| public void | start()
copyThread.start();
|
|