title: Fastest way of reading file into OS file cache
body: <p>I am looking for the fastest way of reading a file - I don't need to see the read bytes, I just need the file to be fully read so that it gets in the OS file cache.</p>
  
  <p>This is what I am using at the moment (but it involves allocating a direct buffer for each file)</p>
  
  <pre><code>   FileInputStream f = new FileInputStream( file );
     FileChannel ch = f.getChannel( );
     ByteBuffer bb = ByteBuffer.allocateDirect((int)file.length() );
     ch.read(bb);
  </code></pre>