readByte method
Read a single byte from the stream
Implementation
Future<int> readByte() async {
if (_closed) {
throw StateError('BufferedP2PStreamReader is closed');
}
// Fill buffer if needed
while (_buffer.remainingLength == 0 && !_eof) {
await _fillBuffer(1);
}
if (_buffer.remainingLength == 0) {
throw Exception('Unexpected EOF while reading byte');
}
return _buffer.readUint8();
}