terminator

Writing a stream protocol: Message size field or Message delimiter?

Hi all, I am about to write a message protocol going over a TCP stream. The receiver needs to know where the message boundaries are. I can either send 1) fixed length messages, 2) size fields so the receiver knows how big the message is, or 3) a unique message terminator (I guess this can't be used anywhere else in the message). ...

How to make proper use of java.lang.Terminator?

What does this class exactly do? What is a "termination-triggered shutdowns"? Where have you used this in your program or what could be a good use case for this class? ...