readString method
Implementation
String readString() {
// Read until null terminator or end of stream
int start = _position;
while (_position < _data.length && _data[_position] != 0) {
_position++;
}
String result = utf8.decode(_data.sublist(start, _position));
if (_position < _data.length && _data[_position] == 0) {
_position++; // Skip null terminator
}
return result;
}