title: Best Practices for java IO for creating a large CSV file
body: <p>Hi I need to create few large CSV Files the order of entires could be 2 million. i so i was wondering how to do it efficiently.. and hence few questions crop up my mind</p>
  
  <p>1 . when we Write File via a BufferedWriter how often should we flush?  however i think that bufferedWriter maintains its own buffer and it flushes it automatically once the buffer is full if that is the case then why is flush method there at all ??</p>
  
  <ol>
  <li><p>As the file i am going to create would be big . so when i start writing the file will the file be automatically be committed to disk?? (before calling writer.close())   or    the whole file remains in the main memory till i close the writer?.</p>
  
  <ul>
  <li>by commiting i mean that no part of the already written portion is in main memory i.e it is ready for GC</li>
  </ul></li>
  </ol>