if (last && level == levels.size() - 1)
return;
IndexBlock iblock = levels.get(level);
if ((iblock.getSize() > threshold && iblock.offsets.size() > 1) || last) {
ABlockWriter out = blockFileWriter.prepareDataBlock();
iblock.setHasNext(!last);
iblock.write(out);
out.close();
add(level + 1, lastKey, 0, out.getStartPos(), out.getCompressedSize(), out.getRawSize());
flush(level + 1, lastKey, last);
if (last)
levels.set(level, null);
else