title: Java: thread-safe RandomAccessFile
body: <p>After some serious googleing I found out that the RandomAccessFile-class is not thread-safe. Now I could use one semaphore to lock all reads and writes but I don't think that performs very well. In theory it should be possible to do multiple reads and one write at a time.
  How can I do this in Java? Is it possible at all?</p>
  
  <p>Thanks!</p>