`PipedInputStream` and `PipedOutputStream` are used for inter-thread data transfers. "Data is read from a `PipedInputStream` object by one thread and data is written to the corresponding `PipedOutputStream` by some other thread".

So far, so good. One potential benefit I see from this paradigm is that a sporadic producer (`OutputStream`) does not need to be slowed down by a slow consumer (`InputStream`). In other words, in times when the `OutputStream` suddenly produces a great amount of data that the consumer is not able to consume right away, the `OutputStream` does not need to wait for the produced data to be fully consumed before getting on with its life.

Question 1: Is my understanding correct? Is this one of the benefits of this PipedStreams construct?

If the answer to Question 1 is yes, then:

This works well when the buffer is not full, but when the buffer is full, in JDK6's implementation, the PipedOutputStream blocks and waits for more space to free up. This beats the purpose that I mentioned above, doesn't it?

The issue seems to be very easy to solve by changing the behavior in cases of full bufferes from waiting for new space to allocating a bigger buffer. I can probably implement one in a couple of minutes, but I'd hate to reinvent the wheel if something like that is already available out there. I googled around quite a bit, but couldn't find any however, which is quite surprising to me.

Can someone point me to the right direction? Or point out where I'm wrong in my thinking?

Thanks