dynamically expanding byte container?
Imagine this scenario:
You have a message which you receive as blocks of bytes. The total size of the message is unknown from the start but is indicated to you in the last block (imagine with EOF).
I cannot use a byte array of fixed size because the max size is unknown from the start. I need something that can EXPAND DYNAMICALLY.
There is something called ByteBuffer that could probably be suited for this. Any other ideas/recommendations?
Also...imagine these messages have an ID attached to them, and that many are sent simultaneously, that is: they come intermigled (mixed). What would you do to keep them separated?
Thanks for any help you can provide!