These classes let you combine several streams into one. BundleOutputStream packs several OutputStreams (called channels) into a single OutputStream. BundleInputStream separates a bundle back into the original channels. Channels are identified by Strings, so you can give them names that make sense for your program.
A bundle could be used for a log file, with separate channels for debug info and normal data. Bundles can also help if your program has a lot of data streams, but only a few physical connections. For example, if an applet runs 1000 threads, each generating information that needs to be sent to the server, it would be very inefficient to use a separate Socket for each thread. But with a bundle, only one Socket is needed, and each thread can use a separate channel.
Channels are read and written to the bundle in parallel, so you don't have to finish reading/writing one channel before starting to read/write a second channel.
Here is the documentation.
And here is the source.
If you want to use these classes, I request only that you let me know by sending email to kimbly - at - pobox - dot - com.
Last updated October 19, 1996
Back to Kimberley's Code.
Back to Kimberley's Home Page.