/** * Serialize the configuration object to an output stream. * @param outputStream an <code>OutputStream</code> value * @param source a <code>Configuration</code> value * @throws SAXException if an error occurs * @throws IOException if an error occurs * @throws ConfigurationException if an error occurs */ public void serialize( final OutputStream outputStream, final Configuration source ) throws SAXException, IOException, ConfigurationException { serialize( createContentHandler( new StreamResult( outputStream ) ), source ); }
/** * Serialize the configuration object to a string * @param source a <code>Configuration</code> value * @return configuration serialized as a string. * @throws SAXException if an error occurs * @throws ConfigurationException if an error occurs */ public String serialize( final Configuration source ) throws SAXException, ConfigurationException { final StringWriter writer = new StringWriter(); serialize( createContentHandler( new StreamResult( writer ) ), source ); return writer.toString(); } }