readInto method

  1. @override
Future<ReadResult> readInto(
  1. ReadBuf dst
)
override

Implementation

@override
Future<ReadResult> readInto(ReadBuf dst) async {
  if (_position >= end) return const ReadResult(0, eof: true);
  final n = (end - _position).clamp(0, dst.remaining);
  dst.unfilled.setRange(0, n, bytes, _position);
  dst.advance(n);
  _position += n;
  return ReadResult(n, eof: _position >= end);
}