public void text(Writer out, String text, boolean escapeAmpersands) throws NullPointerException, InvalidXMLException, IOException {

        text(out, text.toCharArray(), 0, text.length(), escapeAmpersands);
    }
public void text ( Writer out , String text , boolean escapeAmpersands ) throws NullPointerException , InvalidXMLException , IOException { text ( out , text . toCharArray ( ) , 0 , text . length ( ) , escapeAmpersands ) ; }
Writes the specified text. Any characters that are non-printable in this
encoding will be escaped.
<p />
It must be specified whether ampersands should be escaped. Unless ampersands are escaped,
entity references can be written.

@param out              the character stream to write to, not <code>null</code>.
@param text             the text to be written, not <code>null</code>.
@param escapeAmpersands flag that indicates whether ampersands should be escaped.
@throws NullPointerException if <code>out == null || text == null</code>.
@throws InvalidXMLException  if the specified text contains an invalid character.
@throws IOException          if an I/O error occurs.