Search code examples
javaabstractionrandom-access

Java 1.6 abstracted random access


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.)


Solution

  • This is what Java NIO is for.

    See Random Access Files and Memory-mapped files.