I have code like this to make the XML file serialize:
private byte[] bytes; ... OutputStream byteArrayOutputStream = new ByteArrayOutputStream(); XmlSerializer newSerializer = Xml.newSerializer(); newSerializer.setOutput(byteArrayOutputStream, "utf-8"); newSerializer.startDocument("utf-8", null); newSerializer.startTag(null, "playlist"); newSerializer.attribute(null, "version", "1.0"); ... put all my XML tags ... newSerializer.endTag(null, "playlist"); newSerializer.endDocument(); this.bytes= byteArrayOutputStream.toByteArray();
What I need to do: convert this byte array to an XML file again, and I don't know how to do it!
source share