docs: private void updateEntry(HashtableEntry entry)
                      throws IOException, EOFException, FileManagerException, ClassNotFoundException {
          //
          // We'll write the header, key, and data into a byte arry first,
          // then allocate, seek, and write with a single write operation.
          // It is necessary to buffer the data first like this because we cannot
          // determine the size of storage to allocate without first examining the
          // size of the serialize object.
          //
  
          //
          // Serialize key and data.  If the data is already a byte[] array, we can
          // bypass serialization.
          //
          byte[] serializedKey = entry.serializedKey;
          int keySize = 0;
          byte[] serializedValue = null;
          int valueSize = -1;
          int bytes = 0;
          byte[] serializedCacheValue = entry.serializedCacheValue;
          int cacheValueSize = -1;
          int dataSize = HTENTRY_OVERHEAD_SIZE;
  
          if (serializedKey == null) {
              if (keyout == null) {
                  keyout = new ByteArrayPlusOutputStream(500);
              } else {
                  keyout.reset();
              }
              serializeTimer.reset();
              ObjectOutputStream out = new ObjectOutputStream(keyout);
              out.writeObject(entry.key);
              out.close();
              serializedKey = keyout.getTheBuffer();
              keySize = keyout.size();
              bytes_serialized += keySize;
          } else {
              keySize = entry.serializedKey.length;
          }
          dataSize += keySize;
  
          if (entry.value != null) {
              if (isByteArray(entry.value)) {
                  bytes = 1;
                  serializedValue = (byte[]) entry.value;
                  if (entry.valuelen != -1) {
                      valueSize = entry.valuelen;
                  } else {
                      valueSize = serializedValue.length;
                  }
              } else {
                  if (dataout == null) {
                      dataout = new ByteArrayPlusOutputStream(500);
                  } else {
                      dataout.reset();
                  }
                  ObjectOutputStream out = new ObjectOutputStream(dataout);
                  out.writeObject(entry.value);
                  out.close();
                  serializedValue = dataout.getTheBuffer();
                  valueSize = dataout.size();
                  bytes_serialized += valueSize;
                  //
                  // If an unusally large object is written it bloats the buffer, which can
                  // hog resources.  If this happens dump the static buffer and start a new 
                  // one on the next write.
                  //
                  if (valueSize > 100000) {
                      dataout = null;
                  }
              }
          }
  
          serialize_time += serializeTimer.elapsed();
  
          int allocateSize = DWORDSIZE + // room for "next"
                             SWORDSIZE + // room for fastpath hash key
                             DWORDSIZE + // room for old format: last-modified
                                         //          new format: validator expiration time(VET)
                             DWORDSIZE + // room for old format: last-referenced;   // LI4337-17
                                         //          new format: H-Word = unused 
                                         //                      L-word = cache value hashcode 
                             DWORDSIZE + // room for first_created
                             DWORDSIZE + // room for expiration (RET)
                             DWORDSIZE + // room for flag + object size
                             SWORDSIZE + // room for size of the key
                             keySize + // room for serialized key
                             SWORDSIZE + // room for bytes flag
                             SWORDSIZE; // room for size of the value
  
          if (valueSize != -1) {
              allocateSize += valueSize; // room for serialized value
              dataSize += valueSize; // add value size to data size 
          }
  
          if (this.bHasCacheValue && !entry.bAliasId) {
              allocateSize += SWORDSIZE; // room for size of cacheValue
              if (serializedCacheValue != null) { // any cacheValue?
                  cacheValueSize = serializedCacheValue.length; // size of the cacheValue
                  allocateSize += cacheValueSize; // room for serialized cacheValue
                  dataSize += cacheValueSize; // add cacheValue size to data size
              }
          }
          if (dataSize % 512 != 0) { // size adjustment for 512 blocks
              dataSize = (dataSize / 512 + 1) * 512;
          }
          //System.out.println("**** HashtableOnDisk: id=" + entry.key + " size=" + dataSize + " allocateSize=" + allocateSize);
          long tempData = 0;
          if (entry.bAliasId) {
              tempData = HTENTRY_MAGIC + HTENTRY_VERSION + HTENTRY_ALIAS_ID + dataSize;
          } else {
              tempData = HTENTRY_MAGIC + HTENTRY_VERSION + dataSize;
          }
  
          // end write key and value
          //
          // physical allocation
          //
  
          // For testing for cache id 
          //String testId = (String)entry.key;
          //if (testId.indexOf("928") > 0 || testId.indexOf("1028") > 0) {
          //    throw new IOException(com.ibm.ws.cache.HTODDynacache.DISK_CACHE_IN_GB_OVER_LIMIT_MSG);
          //}
          // For testing for depid/template
          //if (!this.bHasCacheValue) {
          //    String testId = (String)entry.key;
          //    if (testId.indexOf("926") > 0) {
          //        throw new IOException(com.ibm.ws.cache.HTODDynacache.DISK_CACHE_IN_GB_OVER_LIMIT_MSG);
          //    }
          //}
          entry.location = filemgr.allocate(allocateSize);
  
          initWriteBuffer();
          headerout.writeLong(entry.next);
          headerout.writeInt(entry.hash);
          //headerout.writeLong(System.currentTimeMillis());  // old format: last update
          headerout.writeLong(entry.validatorExpiration); // new format: VET
          //headerout.writeLong(System.currentTimeMillis());  // old format: last reference
          headerout.writeInt(0); // new format: unused    // LI4337-17
          headerout.writeInt(entry.cacheValueHashcode); //             cache value hashcode
          headerout.writeLong(entry.first_created); // when object is first created
          headerout.writeLong(entry.expiration); // expiration (RET) 
          headerout.writeLong(tempData); // write magic, version, flag & data size 
          headerout.writeInt(keySize);
          headerout.flush();
  
          //
          // Physical write the record like this:
          filemgr.seek(entry.location);
          filemgr.write(headeroutbuf);
          //
          // int keysize;            length of key
          // byte[] serialized key;  The key
          // int valueSize           length of value
          // int value_is_byte_array 0 if value is serialized obj 1 if a byte array
          // byte[] value            serialized value
          //
          filemgr.write(serializedKey, 0, keySize);
          filemgr.writeInt(bytes);
          filemgr.writeInt(valueSize);
          if (valueSize != -1) {
              filemgr.write(serializedValue, 0, valueSize);
          }
  
          //
          // if there is any cacheValue
          // int cacheValueSize      size of cacheValue - -1 if cacheValue is empty
          // byte[] cacheValue   serialized cacheValue
          //
          if (this.bHasCacheValue) {
              filemgr.writeInt(cacheValueSize);
              if (cacheValueSize != -1) {
                  filemgr.write(serializedCacheValue, 0, cacheValueSize);
              }
          }
  
          //if (serializedCacheValue != null) {
          //   traceDebug("updateEntry()", "cacheName=" + this.htoddc.cacheName + " key=" + entry.key + " allocateSize=" + allocateSize + " dataSize=" + dataSize + " valueSize=" + valueSize + " cacheValueSize=" + cacheValueSize);
          //} else {
          //    traceDebug("updateEntry()", "cacheName=" + this.htoddc.cacheName + " key=" + entry.key + " allocateSize=" + allocateSize + " valueSize=" + valueSize);
          //}
      }