Try this: 

                try(OutputStream os = 
OutputStreamWriter writer = new OutputStreamWriter(os)) {
                    xw.writeXML(writer, root);
                } catch(IOException err) {

It looks like your code closes the output stream instead of the writer. 
This can discard unflushed bytes.

You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to