Microsoft SDK for Java

setEncoding

This method of the XMLOutputStream class defines the character encoding of the output stream.

Syntax

public void setEncoding(String encoding, boolean littleendian, boolean byteOrderMark) throws IOException;

Parameters

encoding The type of character encoding. This can be one of the following formats:
  1. UTF-8

  2. Shift_JIS

  3. ISO-8859-1

  4. ISO-10646-UCS-4 (not yet supported)

  5. UCS-2

The default character encoding is ASCII.

littleendian Set this parameter to true to specify whether the stream is in little endian format.
byteOrderMark This flag is only relevant if the character encoding type is UCS-2. Otherwise, it is ignored.

Exceptions

IOException if the encoding type is not supported by the currently installed virtual machine.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.