writeChar abstract method

Future<void> writeChar(
  1. int c
)

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

Future<void> writeChar(int c);