final List<Item> decodedItems = _decodedItems;
final int decodedCount = decodedItems.size();
final int curPos = focus.getContextPosition();
if(curPos < decodedCount) {
final Item it = decodedItems.get(curPos);
if(it == null) {
throw new IllegalStateException();
}
focus.setContextItem(it);
return true;
}
if(_decodeFinished) {
focus.setReachedEnd(true);
focus.closeQuietly();
if(!_reaccessable) {//TODO
this._decodedItems = Collections.emptyList();
}
return false;
}
final XDMTreeBuilder treeBuilder = _treeBuilder;
final int last = _decodeUnit - 1;
for(int i = 0; i < _decodeUnit; i++) {
final Item item;
try {
item = _decoder.decodeItem(treeBuilder);
} catch (IOException e) {
throw new XQueryException("failed decoding an Item", e);
} finally {