# reset method

1. @override

Future<void> reset()
override

Resets the stream.

If the stream has been marked, then attempt to reposition it at the mark. If the stream has not been marked, then attempt to reset it in some way appropriate to the particular stream, for example by repositioning it to its starting point.

## Example

    final reader = BufferedReader(FileReader('data.txt'));
    if (reader.markSupported()) {
      reader.mark(1024);

      // Read and analyze some data
      final sample = await reader.readLine();

      if (needsReprocessing(sample)) {
        // Reset to marked position and reprocess
        await reader.reset();
        reprocessData(reader);
      }
    }

Throws IOException if the stream has not been marked, or if the mark has been invalidated, or if the stream does not support reset, or if some other I/O error occurs.

## Implementation

    @override
    Future<void> reset() async {
      checkClosed();
      _position = _markedPosition;
    }