Example #1
0
        public static long SerializedSizeOfHeader(KafkaRecordHeader header)
        {
            header.Validate();
            var keySize = Basics.SizeOfSerializedString(header.Key);

            return(keySize + header.Value.Length + VarIntConverter.SizeOfVarInt(keySize) + VarIntConverter.SizeOfVarInt(header.Value.Length));
        }
Example #2
0
 public static ReusableMemoryStream SerializeHeader(ReusableMemoryStream target, KafkaRecordHeader header)
 {
     header.Validate();
     Basics.SerializeStringWithVarIntSize(target, header.Key);
     Basics.SerializeBytesWithVarIntSize(target, header.Value);
     return(target);
 }