Have posted this to https://github.com/jcrowley66/BroadcastInputStream <https://github.com/jcrowley66/BroadcastInputStream> as a potential contribution if considered generally useful.
A BroadcastInputStream will broadcast a copy of the base InputStream to 1-N BroadcastConsumers - which are usually running in separate threads. A set of internal buffers are shared in order to minimize the amount of memory required and also to reduce synchronization events. Additional details are provided in the comments of the BroadcastInputStream.java file. Glad to answer any questions. Best, John Crowley Charlotte, NC 203-856-2396