This method of the XMLInputStream class defines the character encoding of the input stream.
public void setEncoding(String encoding) throws IOException;
encoding | The type of character encoding. This can be one of the following formats:
The default character encoding is ASCII. |
The character encoding must agree with the encoding determined by the constructor. The setEncoding method is used to clarify encodings that cannot be fully determined by reading the first four bytes in a stream. setEncoding is not used to change the encoding of a stream. It must be called within 4096 read() operations after the XMLInputStream object's creation.
IOException if the encoding type is not supported by the currently installed virtual machine.