title: java append to file
body: <p>I googled for this for a while but can't seem to find it and it should be easy. I want to append a CR to then end of an XML file that I am creating with a Transformer. Is there a way to do this></p>
  
  <p>I tried the following but this resulted in a blank file?</p>
  
  <pre><code>
  Transformer xformer = TransformerFactory.newInstance().newTransformer();
  xformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "file:///ReportWiz.dtd");
  xformer.transform(source, result);
  OutputStream writer = new FileOutputStream(file);
  Byte b = '\n';
  writer.write(b);
  writer.close();</code></pre>