public ByteBuffer write() throws IOException {
private ByteBuffer write() throws IOException {
  public ByteBuffer write() throws IOException {    ByteBuffer buffer = _pageChannel.createPageBuffer();    buffer.put((byte) 0x04);  //Page type    buffer.put((byte) 0x01);  //Unknown    buffer.putShort((short) 0); //Free space    buffer.putInt(_parentPageNumber);    buffer.putInt(0); //Prev page    buffer.putInt(0); //Next page    buffer.putInt(0); //Leaf page    buffer.putInt(0); //Unknown    buffer.put((byte) 0); //Unknown    buffer.put((byte) 0); //Unknown    buffer.put((byte) 0); //Unknown    byte[] entryMask = new byte[_format.SIZE_INDEX_ENTRY_MASK];    int totalSize = 0;    Iterator iter = _entries.iterator();    while (iter.hasNext()) {      Entry entry = (Entry) iter.next();      int size = entry.size();      totalSize += size;      int idx = totalSize  / 8;      entryMask[idx] |= (1 << (totalSize % 8));    }    buffer.put(entryMask);    iter = _entries.iterator();    while (iter.hasNext()) {      Entry entry = (Entry) iter.next();      entry.write(buffer);    }    buffer.putShort(2, (short) (_format.PAGE_SIZE - buffer.position()));    return buffer;  }