code: final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) {
  		if (!isDirty()) {
  			return pageId;
  		}
  
  		Integer pageIdpre = map.get(this); 
  		if (pageIdpre == null) {
  			throw DBLogger.newFatalInternal("Page not preallocated: " + pageId + " / " + this);
  		}
  		
  		if (isLeaf) {
  			//Page was already reported to FSM during map build-up
  			out.seekPageForWrite(ind.getDataType(), pageId);
  			out.writeShort((short) 0);
  			writeData(out);
  		} else {
  			//now write the sub pages
  			for (int i = 0; i < getNKeys()+1; i++) {
  				AbstractIndexPage p = subPages[i];
  				if (p == null) {
  					//This can happen if pages are not loaded yet
  					continue;
  				}
  				subPageIds[i] = p.writeToPreallocated(out, map);
  			}
  
  			//now write the page index
  			out.seekPageForWrite(ind.getDataType(), pageId);
  			out.writeShort((short) subPages.length);
  			out.noCheckWrite(subPageIds);
  			writeKeys(out);
  		}
  		out.flush();
  		setDirty( false );
  		ind.statNWrittenPages++;
  		return pageId;
  	}
docs: This method takes as argument a map generated by createWriteMap(). These methods are
  especially created for the free space manager. But it also enables other indices to
  first write the inner nodes followed by leaf nodes.
  This write method does not allocate any pages, but takes pre-allocated pages from the
  supplied map. This is necessary for the free space manager, because allocating new
  pages during the write() process would change the free space manager again, because
  allocation is often associated with releasing a previously used page.
  @param map
  @return new page ID