# BufferedReader constructor

BufferedReader(

1. Reader reader, {
2. int bufferSize = _defaultBufferSize,

})

Creates a buffering character-input stream that uses a default-sized input buffer.

## Parameters

- `reader`: The underlying character reader
- `bufferSize`: The buffer size (default: 8192 characters)

## Example

    final buffered = BufferedReader(FileReader('document.txt'));
    final largeBuffered = BufferedReader(
      FileReader('huge_document.txt'),
      bufferSize: 65536
    );

Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.

The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.

## Example Usage

    // Basic buffered reading
    final buffered = BufferedReader(FileReader('document.txt'));
    try {
      String? line;
      while ((line = await buffered.readLine()) != null) {
        print('Line: $line');
      }
    } finally {
      await buffered.close();
    }

    // Using mark and reset for lookahead
    final buffered = BufferedReader(FileReader('config.txt'));
    try {
      buffered.mark(1024);

      final firstLine = await buffered.readLine();
      if (firstLine?.startsWith('<?xml') == true) {
        await buffered.reset(); // Go back to beginning
        processAsXml(buffered);
      } else {
        await buffered.reset(); // Go back to beginning
        processAsText(buffered);
      }
    } finally {
      await buffered.close();
    }

## Implementation

    BufferedReader(Reader reader, {int bufferSize = _defaultBufferSize})
        : _reader = reader,
          _buffer = List<int>.filled(bufferSize, 0);