encoding / decoding proto messages.