skip method

Future<int> skip (int count)

Skips the next count data events.

The count must be non-negative.

When successful, this is equivalent to using take and ignoring the result.

If an error occurs before count data events have been skipped, the returned future completes with that error instead.

If the stream closes before count data events, the remaining unskipped event count is returned. If the returned future completes with the integer 0, then all events were succssfully skipped. If the value is greater than zero then the stream ended early.

Implementation

Future<int> skip(int count) {
  if (count < 0) throw new RangeError.range(count, 0, null, "count");
  if (!_isClosed) {
    var request = new _SkipRequest<T>(count);
    _addRequest(request);
    return request.future;
  }
  throw _failClosed();
}