File packFile = new File(packDir, packName + ".pack");
FileUtils.mkdir(packDir, true);
OutputStream dst = new SafeBufferedOutputStream(new FileOutputStream(
idxFile));
try {
PackIndexWriter writer = new PackIndexWriterV2(dst);
writer.write(objects, new byte[OBJECT_ID_LENGTH]);
} finally {
dst.close();
}
new FileOutputStream(packFile).close();