toBytes method

Uint8List toBytes()

Implementation

Uint8List toBytes() {
  final writer = _Writer()..int16(version);
  writer.int32(topics.length);
  for (final topic in topics) {
    writer.string(topic);
  }
  writer.bytes(userData);
  if (version >= 1) writer.partitions(ownedPartitions);
  if (version >= 2) writer.int32(generationId);
  if (version >= 3) writer.string(rackId);
  return writer.result();
}