ListOffsetsRequest constructor
ListOffsetsRequest(
- String topic, {
- int partition = 0,
- 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');
}
}