As a java guru, what would you suggest to abstract random access so that a code can be agnostic to whether the data its accessing is in memory or in a file on the harddrive?
(The files in question could be several gigabytes in size. Having random access is the most important feature.)
This is what Java NIO is for.
See Random Access Files and Memory-mapped files.