Fast Flexible efficient in memory LRU Java cache This repository has the sources to my post. You may copy or use any part of the code freely. Barak. Sample Usage:
Cache<String, byte[]> fileContentCache =
new Cache<String, byte[]>(new Compute<String, byte[]>() {
@Override
public byte[] compute(String key) throws Exception {
return readFileContent(new File(key));
}
}, 10);
See examples directory.