use of de.invesdwin.util.collections.iterable.ICloseableIterator in project invesdwin-context-persistence by subes.
the class FileBufferCache method resultCache_load.
private static ArrayFileBufferCacheResult resultCache_load(final ResultCacheKey key) throws Exception {
final ICloseableIterable values = key.getSource().getSource();
key.setSource(null);
final ArrayList list = LIST_POOL.borrowObject();
try (ICloseableIterator it = values.iterator()) {
while (true) {
list.add(it.next());
}
} catch (final NoSuchElementException e) {
// end reached
}
return new ArrayFileBufferCacheResult(list);
}
Aggregations