out.close();
}
out = objdb.writeFile(pack, INDEX);
try {
CountingOutputStream cnt = new CountingOutputStream(out);
pw.writeIndex(cnt);
pack.addFileExt(INDEX);
pack.setFileSize(INDEX, cnt.getCount());
pack.setIndexVersion(pw.getIndexVersion());
} finally {
out.close();
}
if (pw.prepareBitmapIndex(pm)) {
out = objdb.writeFile(pack, BITMAP_INDEX);
try {
CountingOutputStream cnt = new CountingOutputStream(out);
pw.writeBitmapIndex(cnt);
pack.addFileExt(BITMAP_INDEX);
pack.setFileSize(BITMAP_INDEX, cnt.getCount());
} finally {
out.close();
}
}