void save() throws Exception { ByteBuffer buffer = ByteBuffer.allocate(1); buffer.put(rootPage.getUnique() ? (byte) 1 : (byte) 0); buffer.position(0); raFile.write(buffer); ((FileIndexNode) rootPage).save(); }
static FileIndex load(FileChannel raFile) throws Exception { ByteBuffer buffer = ByteBuffer.allocate(1); raFile.read(buffer); buffer.position(0); boolean unique = buffer.get() != 0; FileIndexNode root = FileIndexNode.loadRootNode(unique, raFile, raFile.position()); return new FileIndex(root, raFile); }