public XMLEncoder (OutputStream out, String charset, boolean declaration, int indentation)

Creates a new XML encoder to write out JavaBeans to the stream out using the given charset starting from the given indentation.

out    the stream to which the XML representation of the objects will be written
charset    the name of the requested charset; may be either a canonical name or an alias
declaration    whether the XML declaration should be generated; set this to false when embedding the contents in another XML document
indentation    the number of space characters to indent the entire XML document by

IllegalArgumentException     if out or charset is null, or if indentation is less than 0
IllegalCharsetNameException     if charset name is illegal
UnsupportedCharsetException     if no support for the named charset is available in this instance of the Java virtual machine
UnsupportedOperationException     if loaded charset does not support encoding

See also:

Since:  1.7