throw new IOException("File does not exist: " + name);
else
{
DatabaseEntry key = new DatabaseEntry(new byte[24]);
DatabaseEntry data = new DatabaseEntry((byte[]) null);
Db blocks = directory.blocks;
DbTxn txn = directory.txn;
int flags = directory.flags;
key.setUserBuffer(24, true);
data.setPartial(true);
uuid = new byte[16];
try {
do {
/* generate a v.4 random-uuid unique to this db */
random.nextBytes(uuid);
uuid[6] = (byte) ((byte) 0x40 |
(uuid[6] & (byte) 0x0f));
uuid[8] = (byte) ((byte) 0x80 |
(uuid[8] & (byte) 0x3f));
System.arraycopy(uuid, 0, key.getData(), 0, 16);
} while (blocks.get(txn, key, data,
flags) != DbConstants.DB_NOTFOUND);
} catch (DatabaseException e) {
throw new IOException(e.getMessage());
}
}