code: public synchronized void setVal(int offset, Constant val) {
  		byte[] byteval = val.asBytes();
  
  		// Append the size of value if it is not fixed size
  		if (!val.getType().isFixedSize()) {
  			// check the field capacity and value size
  			if (offset + ByteHelper.INT_SIZE + byteval.length > BLOCK_SIZE)
  				throw new BufferOverflowException();
  
  			byte[] sizeBytes = ByteHelper.toBytes(byteval.length);
  			contents.put(offset, sizeBytes);
  			offset += sizeBytes.length;
  		}
  
  		// Put bytes
  		contents.put(offset, byteval);
  	}
docs: Writes a constant value to the specified offset on the page.
  
  @param offset
  the byte offset within the page
  
  @param val
  the constant value to be written to the page