ListOffsetsRequest constructor

ListOffsetsRequest(
  1. String topic, {
  2. int partition = 0,
  3. required KafkaOffsetPosition position,
})

Validates the topic's nonempty UTF-8 STRING and nonnegative INT32 partition.

Implementation

ListOffsetsRequest(this.topic, {this.partition = 0, required this.position}) {
  final encoded = utf8.encode(topic);
  if (topic.isEmpty ||
      encoded.length > 32767 ||
      utf8.decode(encoded) != topic ||
      partition < 0 ||
      partition > 2147483647) {
    throw ArgumentError('Invalid ListOffsets topic or partition');
  }
}