readUtil function
Stream util for ...
Implementation
Future<String> readUtil(
RandomAccessFile file, {
int charCode: 10, // LF
}) async {
var bytes = <int>[];
while (true) {
final int char = await file.readByte();
if (char == -1) {
throw StateError("eof");
}
if (char == charCode) break;
bytes.add(char);
}
return String.fromCharCodes(bytes);
}