readString method
Like readBytes, but returns an ASCII string.
Implementation
Future<String?> readString(int length) async {
final bytes = await readBytes(length);
if (bytes != null) {
return String.fromCharCodes(bytes);
} else {
return null;
}
}