The NewData is used to bring in data and put together in buffer. When data is complete, then call is made to process, and clear processed data from buffer. Data does not always arrive at once, so assemble in static buffer, is important step. There are many ways for protocol to help handle data, that frame, count, checksum... and correct or reset in the event of errors.
Erel has written Text class for AsyncStreams with tutorial. It shows how to receive text string with an end terminator.