Bem, eu crio uma xml e guardo num OutputStream, como eu faço para gerar um arquivo atraves dessa OutputStream???
M9999 m = new M9999();
OutputStream outputStream = null;
m.writeMessage();
try {
outputStream = m.xmlMessage();
outputStream.flush();
} catch (IOException e) {
e.printStackTrace();
}
File file = new File("C:\\M9999.xml");
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
System.exit(0);
}
System.out.println("mensagem criada com sucesso");