title: Writing JSONArray to file, only writes first collection of values
body: <p>When the following code is executed, print function prints all the elements within the jsonarray, but the writer, only the first collection of elements.</p>
  
  <p>So far I've tried what is shown in the code, plus, iterating through the list</p>
  
  <pre><code>public class FileWrapper {
  
      public static void WriteRelease(String filename, ArrayList&lt;Object&gt; list) throws IOException, JSONException{
  
          File file = new File(filename);
          FileWriter filew = new FileWriter(filename);  
          JSONArray jsonarray = new JSONArray();
  
          //System.out.println(jsonarray.put(list).toString());
          jsonarray.add(list);
          System.out.println(jsonarray);
          jsonarray.writeJSONString(jsonarray,filew);
          filew.close();
      }
  }
  </code></pre>
  
  <p>The output I want written in the file is the same as the standard output:</p>
  
  <blockquote>
    <p>[[Title - Eminem Is Back  Status - Bootleg  Language - eng 
    ReleaseDate - 2004-09-28  Format - CD  Track Count - 11]] [[Title -
    The Eminem Show  Status - Official  Language - eng  ReleaseDate - 2002
    Format - Digital Media  Track Count - 20]] [[Title - The Eminem Show 
    Status - Official  Language - eng  ReleaseDate - 2002  Format -
    Digital Media  Track Count - 19]]</p>
  </blockquote>
  
  <p>Again, what is written is only this:</p>
  
  <blockquote>
    <p>[[Title - Eminem Is Back  Status - Bootleg  Language - eng 
    ReleaseDate - 2004-09-28  Format - CD  Track Count - 11]]</p>
  </blockquote>