title: Writing an entire list to a file in java
body: <p>I am working on a big project where I have more than 1 million lines of data. Data is divided into various files containing 20,000 lines each. Now the data from each file is read line by line and some variable x is concatenated to each line. I am storing these concatenated string to an array list. Then this array list is saved to output files line by line.</p>
  
  <p>This is taking 3-4 minutes on each file. Is there anyway to write the entire <code>ArrayList</code> to a file in one go, so that it won't take that much time. Or is there any faster way to do this?</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>    List&lt;String&gt; outputData = new ArrayList&lt;String&gt;(); 
  //Output arraylist containing concatenated data
  
  writeLines(File outputFile,outputData); //The data is written to file
  </code></pre>
  
  <p>What would be the fastest way to achieve this task?</p>