A PipedInputStream/PipedOutputStream connection works great when the data only needs to be piped to one output, but if multiple output streams are connected to one input stream, the data becomes fragmented across the different outputs. My current solution involves having a threaded "reader" that reads data from an InputStream and then writes the data to OutputStream objects that have been associated with the reader. This seems to work ok, but it seems messy and inefficient by comparison to the native PipedIO classes.
Is there a better way to handle this or is the implementation that I'm working with about as good as I'm going to get?