title: Trouble with filewriter overwriting files instead of appending to the end
body: <p>OK, I'm having some trouble writing multiple lines to a text file.</p>
  
  <p>the program runs, but it won't use new lines each time</p>
  
  <p>when I want it run 4 times, the text file should look like:</p>
  
  <pre><code>a
  b
  c
  d
  </code></pre>
  
  <p>instead, it looks like:</p>
  
  <pre><code>d
  </code></pre>
  
  <p>who knows how to fix this problem? all imports are correctly imported.</p>
  
  <p>source(it's been slightly edited, assume everything is properly defined):</p>
  
  <pre><code>import java.io.*;
  public class Compiler {
  public static void main (String args[]) throws IOException
  {
      //there's lots of code here
      BufferedWriter outStream= new BufferedWriter(new FileWriter("output.txt"));
      outStream.newLine();
      outStream.write(output);
      outStream.close();
  }
  
  }
  </code></pre>