addString method

void addString(
  1. String value
)

Adds Kafka string to this bytes builder.

Kafka string type starts with int16 indicating size of the string followed by the actual string value.

Implementation

void addString(String value) {
  List<int> data = utf8.encode(value);
  addInt16(data.length);
  _builder.add(data);
}