Java Array Bulk Flush on Disk
<p>I have two arrays (int and long) which contains millions of entries. Until now, I am doing it using DataOutputStream and using a long buffer thus disk I/O costs gets low (nio is also more or less same as I have huge buffer, so I/O access cost low) specifically, using </p>

<pre><code>DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("abc.txt"),1024*1024*100));

for(int i = 0 ; i &lt; 220000000 ; i++){
    long l = longarray[i];
    dos.writeLong(l);
}
</code></pre>

<p>But it takes several seconds (more than 5 minutes) to do that. Actually, what I want to bulk flush (some sort of main memory to disk memory map). For that, I found a nice approach in <a href="http://www.cs.berkeley.edu/~bonachea/java/dist/doc/html/ti/io/BulkDataInputStream.html" rel="nofollow">here</a> and <a href="http://www.cs.berkeley.edu/~bonachea/java/dist/doc/html/ti/io/BulkDataOutputStream.html" rel="nofollow">here</a>. However, can't understand how to use that in my javac. Can anybody help me about that or any other way to do that nicely ?</p>
