System.IO.BinaryWriter.Write Method

Writes a Unicode character to the current stream and advances the current position of the stream in accordance with the Encoding used and the specific characters being written to the stream.

Syntax

public virtual void Write (char ch)

Parameters

ch
The non-surrogate, Unicode character to write.

Remarks

Because of data formatting conflicts, using this method with the following encodings is not recommended:

  • UTF-7

  • ISO-2022-JP

  • ISCII

For a list of common I/O tasks, see Common I/O Tasks.

Unicode surrogate characters must be written out as pairs together in the same call, not individually. If you require support for surrogate pairs in your application, consider using a character array and the BinaryWriter.Write(Char[]) method overload.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0