protected Table(ByteBuffer buffer, PageChannel pageChannel, JetFormat format, int pageNumber) throws IOException, SQLException { _buffer = buffer; _pageChannel = pageChannel; _format = format; _tableDefPageNumber = pageNumber; int nextPage; ByteBuffer nextPageBuffer = null; nextPage = _buffer.getInt(_format.OFFSET_NEXT_TABLE_DEF_PAGE); while (nextPage != 0) { if (nextPageBuffer == null) { nextPageBuffer = ByteBuffer.allocate(format.PAGE_SIZE); nextPageBuffer.order(ByteOrder.LITTLE_ENDIAN); } _pageChannel.readPage(nextPageBuffer, nextPage); nextPage = nextPageBuffer.getInt(_format.OFFSET_NEXT_TABLE_DEF_PAGE); ByteBuffer newBuffer = ByteBuffer.allocate(_buffer.capacity() + format.PAGE_SIZE - 8); newBuffer.order(ByteOrder.LITTLE_ENDIAN); newBuffer.put(_buffer); newBuffer.put(nextPageBuffer.array(), 8, format.PAGE_SIZE - 8); _buffer = newBuffer; } readPage();
Table() throws IOException { _pageChannel = new PageChannel(null, JetFormat.VERSION_4);
  protected Table(ByteBuffer buffer, PageChannel pageChannel, JetFormat format, int pageNumber)  throws IOException, SQLException  {    _buffer = buffer;    _pageChannel = pageChannel;    _format = format;    _tableDefPageNumber = pageNumber;    int nextPage;		ByteBuffer nextPageBuffer = null;		nextPage = _buffer.getInt(_format.OFFSET_NEXT_TABLE_DEF_PAGE);		while (nextPage != 0) {			if (nextPageBuffer == null) {				nextPageBuffer = ByteBuffer.allocate(format.PAGE_SIZE);				nextPageBuffer.order(ByteOrder.LITTLE_ENDIAN);			}			_pageChannel.readPage(nextPageBuffer, nextPage);			nextPage = nextPageBuffer.getInt(_format.OFFSET_NEXT_TABLE_DEF_PAGE);			ByteBuffer newBuffer = ByteBuffer.allocate(_buffer.capacity() + format.PAGE_SIZE - 8);			newBuffer.order(ByteOrder.LITTLE_ENDIAN);			newBuffer.put(_buffer);			newBuffer.put(nextPageBuffer.array(), 8, format.PAGE_SIZE - 8);			_buffer = newBuffer;		}		readPage();	  }