1

I have the following (old) code:

ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLSerializer output = new XMLSerializer(baos, new OutputFormat(document));
output.serialize(document);
bytes = baos.toByteArray();

I want to update the code above so that it no longer includes deprecated code. I had a look at LSOuput as a replacement but I'm not really sure how to go about it.

C_B
  • 2,620
  • 3
  • 23
  • 45
  • possible duplicate of [Change the com.sun.org.apache.xml.internal.serialize.XMLSerializer & com.sun.org.apache.xml.internal.serialize.OutputFormat](http://stackoverflow.com/questions/9315480/change-the-com-sun-org-apache-xml-internal-serialize-xmlserializer-com-sun-org) – guido Apr 22 '14 at 13:51
  • I couldn't really relate to the answer given to that question. – C_B Apr 22 '14 at 14:04

0 Answers0