openmicroscopy/bioformats — pull request #465 by joshmoore (2013-04-17 22:56:21+00:00)
Title: Kryo memoizer

`loci.formats.Memoizer` is a new `ReaderWrapper` implementatino which memoizes, or cache, all calls to `IFormatReader.setId(String)` by writing out the internal `IFormatReader` delegate using http://kryo.googlecode.com.

Typical usage is to add `Memoizer` as one of the outermost `ReaderWrappers`:

```
Memoizer m = new Memoizer(new MinMaxCalculator());
try {
m.getMemoFile(filename); // Where the file will be saved.
m.setId(filename);
m.isSavedToMemo();
} finally {
m.close();
}
```

Files are currently never cleaned up, and exceptions are ignored. Instead, bad memo files should likely be actively deleted.