Check datalength when receiving protocol buffer.