title: How do I flush a 'RandomAccessFile' (java)?
body: <p>I'm using RandomAccessFile in java:</p>
  
  <pre><code>file = new RandomAccessFile(filename, "rw");
  ...
  file.writeBytes(...);
  </code></pre>
  
  <p>How can I ensure that this data is flushed to the Operating System?  There is no file.flush() method.  (Note that I don't actually expect it to be physically written, I'm content with it being flushed to the operating system, so that the data will survive a tomcat crash but not necessarily an unexpected server power loss).</p>
  
  <p>I'm using tomcat6 on Linux.</p>