Class ThreadLocalInputStream

java.lang.Object
java.io.InputStream
com.martiansoftware.nailgun.ThreadLocalInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

class ThreadLocalInputStream extends InputStream
The class name is pretty descriptive. This creates an InputStream much like a FilterInputStream, but with the wrapped InputStream being local to the current Thread. By setting System.in to a ThreadLocalInputStream, different Threads can read from different InputStreams simply by using System.in. Of course, the init() method must be called by the Thread that wishes to use the wrapped stream.