We could also catch DataChannelShutdown in the run method and exit but this works fine. The run method is a loop that sucks data out of the DataChannel and stuffs it into the objects queuing buffer. Imagine that add is the interface for the DataChannel thread and read is the interface for the user of this object. This applet is pretty cool since it separates the terminal capability and the character display capability into two pieces. This is similar to the other two.
Source is available.