Reading and parsing message streams