protobuf encode