public static int addDataPageRow(ByteBuffer dataPage,int rowSize,JetFormat format,int rowFlags){
  int rowSpaceUsage=getRowSpaceUsage(rowSize,format);
  short freeSpaceInPage=dataPage.getShort(format.OFFSET_FREE_SPACE);
  dataPage.putShort(format.OFFSET_FREE_SPACE,(short)(freeSpaceInPage - rowSpaceUsage));
  short rowCount=dataPage.getShort(format.OFFSET_NUM_ROWS_ON_DATA_PAGE);
  dataPage.putShort(format.OFFSET_NUM_ROWS_ON_DATA_PAGE,(short)(rowCount + 1));
  short rowLocation=findRowEnd(dataPage,rowCount,format);
  rowLocation-=rowSize;
  dataPage.putShort(getRowStartOffset(rowCount,format),(short)(rowLocation | rowFlags));
  dataPage.position(rowLocation);
  return rowCount;
}

public static int addDataPageRow ( ByteBuffer dataPage , int rowSize , JetFormat format , int rowFlags ) { int rowSpaceUsage = getRowSpaceUsage ( rowSize , format ) ; short freeSpaceInPage = dataPage . getShort ( format . OFFSET_FREE_SPACE ) ; dataPage . putShort ( format . OFFSET_FREE_SPACE , ( short ) ( freeSpaceInPage - rowSpaceUsage ) ) ; short rowCount = dataPage . getShort ( format . OFFSET_NUM_ROWS_ON_DATA_PAGE ) ; dataPage . putShort ( format . OFFSET_NUM_ROWS_ON_DATA_PAGE , ( short ) ( rowCount + 1 ) ) ; short rowLocation = findRowEnd ( dataPage , rowCount , format ) ; rowLocation -= rowSize ; dataPage . putShort ( getRowStartOffset ( rowCount , format ) , ( short ) ( rowLocation | rowFlags ) ) ; dataPage . position ( rowLocation ) ; return rowCount ; }
updates free space and row info for a new row of the given size in the given data page . positions the page for writing the row data .
