Java IO Performance Issue
<p>I am using:</p>

<pre><code>PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("test.txt"),1024*1024*500))
</code></pre>

<p>to write a large file (approx. 2GB). It takes 26 seconds to write. But, when I replace 500 with 10/20, it takes 19 seconds.</p>

<p>From <a href="http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/" rel="nofollow">here</a>, what I understood is buffering gives better performance. If so, then why is this happening? I checked it by running 5 times each, so system/IO load is not an issue.</p>
