imageStream<T> static method
Implementation
static Stream<T> imageStream<T>(
Uint8List data,
T req,
T Function(List<int>) f,
) async* {
if (data.lengthInBytes > 100 * 100000) throw 'too large';
yield req;
Iterator<int> it = data.iterator;
for (var _ = 0; _ < 100; _++) {
while (true) {
List<int> list = List.empty(growable: true);
for (var i = 0; i < 100000; i++) {
if (it.moveNext()) {
list.add(it.current);
}
}
if (list.isEmpty) break;
yield f(list);
}
}
}