Add helpers for Kafka protocol serialization