Used google::protobuf::io::CodedOutputStream and CodedInputStream for reading
and writing multiple messages.