docs: int reallocate(int index, int offset, int oldLen, int newLen) {
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "reallocate", new Object[]{Integer.valueOf(index), Integer.valueOf(offset), Integer.valueOf(oldLen), Integer.valueOf(newLen)});
  
      // Get oTable index for the next field after this one, if any. We can be
      // guaranteed that its offsetIndex is one greater than ours, since this is a
      // varying length field.
      int oInx = map.fields[index].offsetIndex + 1;
  
      // Update the oTable in place
      while (oInx < oTable.length) {
        oTable[oInx++] += (newLen - oldLen);
      }
  
      // Compute the length of the balance, after the varying length field
      int balance = (messageOffset + length) - offset - 4 - oldLen;
  
      // Create new contents entry, and update related offsets and lengths
      byte[] oldcontents = contents;
      int oldMessageOffset = messageOffset;
      int oldDataOffset = dataOffset;
      int oldTableOffset = tableOffset;
      length += (newLen - oldLen);
      contents = new byte[length];
      messageOffset = 0;
      tableOffset = dataOffset = oldTableOffset - oldMessageOffset;
  
      // Copy the schemata ids
      System.arraycopy(oldcontents, oldMessageOffset, contents, 0, tableOffset);
  
      // Write the offset table into the new array
      for (int i = 0; i < oTable.length; i++) {
        ArrayUtil.writeInt(contents, dataOffset, oTable[i]);
        dataOffset += 4;
      }
  
      // Copy up to the point where the length is changing
      System.arraycopy(oldcontents, oldDataOffset, contents, dataOffset, offset - oldDataOffset);
  
      // Copy balance of data after varying length field
      if (balance > 0) {
        System.arraycopy(oldcontents, offset + 4 + oldLen, contents, length - balance, balance);
      }
  
      reallocated = true;
  
      // We have a new contents buffer, so it can't be shared
      sharedContents = false;
  
      // Ensure any dependent JSMessageData parts in the cache are updated.
      reallocated(contents, -1);
  
      int result = offset - oldMessageOffset;
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "reallocate", Integer.valueOf(result));
      return result;
    }