Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 public static ReusableMemoryStream SerializeHeader(ReusableMemoryStream target, KafkaRecordHeader header)
 {
     header.Validate();
     Basics.SerializeStringWithVarIntSize(target, header.Key);
     Basics.SerializeBytesWithVarIntSize(target, header.Value);
     return(target);
 }