SpringSource/spring-integration — pull request #702 by garyrussell (2013-01-09 21:54:06+00:00)
Title: INT-2876 Use Custom InputStream For NIO

Previously TcpNioConnection used a pair of Piped(In|Out)putStreams
to pass data from the read event to the deserializer.

However, it is possible to get a 'Broken Pipe' exception if the
last thread that wrote to the pipe terminates.

Replace the use of this pair of streams with an inner class
ChannelInputStream, which provides the same functionality, but
with no dependency on threading.

Uses a BlockingQueue to store read buffers which are consumed by
the message assembler thread (read from the InputStream in the
Deserializer). To avoid OOM conditions, the queue is limited to
5 "unread" buffers; and a timeout will occur if the reader
doesn't consume some data to free up space in the queue.