# writeChar method

1. @override

Future<void> writeChar(

1. int c

)
override

Writes a single character.

The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

## Parameters

- `c`: The character to write (only the low-order 16 bits are used)

## Example

    final writer = FileWriter('output.txt');
    try {
      await writer.writeChar(65); // Write 'A'
      await writer.writeChar(66); // Write 'B'
      await writer.writeChar(67); // Write 'C'
      await writer.flush();
    } finally {
      await writer.close();
    }

Throws IOException if an I/O error occurs. Throws StreamClosedException if the writer has been closed.

## Implementation

    @override
    Future<void> writeChar(int c) async {
      await _ensureOpen();
      _buffer.add(c & 0xFFFF); // Keep only the low 16 bits
    }