page.getPageHeader().setDirty(true);
	private long storeValue(ByteArray value) throws IOException, ReadOnlyException {		final int vlen = value.size();		// does value fit into a single page?		if (6 + vlen > fileHeader.getWorkSize()) {			OverflowPage page = new OverflowPage();			byte[] data = new byte[vlen + 6];			page.getPageHeader().setDataLength(vlen + 6);			ByteConversion.shortToByte((short) 1, data, 0);			ByteConversion.intToByte(vlen, data, 2);			//System.arraycopy(value, 0, data, 6, vlen);			value.copyTo(data, 6);			page.setData(data);			page.getPageHeader().setDirty(true);			page.setDirty(true);			//pages.add( page );			return createPointer((int) page.getPageNum(), 1);		}		DataPage page = null;		short tid = -1;		FreeSpace free = null;		int realSpace = 0;		// check for available tid		while (tid < 0) {			free = fileHeader.findFreeSpace(vlen + 6);			if (free == null) {				page = createDataPage();				page.setData(new byte[fileHeader.getWorkSize()]);				free =					new FreeSpace(						page.getPageNum(),						fileHeader.getWorkSize() - page.getPageHeader().getDataLength());			} else {				page = getDataPage(free.getPage());				// check if the information about free space is really correct				realSpace = fileHeader.getWorkSize() - page.getPageHeader().getDataLength();				if (realSpace < 6 + vlen) {					// not correct: adjust and continue					LOG.debug("wrong data length in list of free pages: adjusting to " + realSpace);					free.setFree(realSpace);					fileHeader.removeFreeSpace(free);					fileHeader.addFreeSpace(free);					continue;				}			}			tid = page.getPageHeader().getNextTID();			if (tid < 0) {				LOG.info("removing page " + page.getPageHeader() + " from free pages");				fileHeader.removeFreeSpace(free);			}		}		// create pointer from pageNum and offset into page		long p = createPointer((int) page.getPageNum(), (int) tid);		int len = page.getPageHeader().getDataLength();		byte[] data = page.getData();		// save tid		ByteConversion.shortToByte(tid, data, len);		len += 2;		// save data length		ByteConversion.intToByte(vlen, data, len);		len += 4;		// save data		value.copyTo(data, len);		//System.arraycopy(value, 0, data, len, vlen);		len += vlen;		page.getPageHeader().setDataLength(len);		page.getPageHeader().incRecordCount();		saveFreeSpace(free, page);		page.setDirty(true);		pages.add(page, 2);		return p;	}