docs: void format(boolean rewriteRequired, WriteableLogRecord logRecord) throws IOException,InternalLogException
    {
      if (tc.isEntryEnabled()) Tr.entry(tc, "format",new java.lang.Object[] {new Boolean(rewriteRequired), logRecord, this});
  
      // If the parent recovery log instance has experienced a serious internal error then prevent
      // this operation from executing.
      if (_recLog.failed())
      {
        if (tc.isEntryEnabled()) Tr.exit(tc, "format", "InternalLogException");
        throw new InternalLogException(null);
      }
  
      _controlLock.getSharedLock(LOCK_REQUEST_ID_RUSI_FORMAT);
  
      int totalDataSize = 0;
      int writtenDataSize = 0; 
      int unwrittenDataSize = 0;
      
      // Calculate the number of written data items
      if (_writtenData != null)
      {
          writtenDataSize = _writtenData.size();
      }
         
      // Calculate the number of unwritten data items
      if (_unwrittenData != null)
      {
          unwrittenDataSize = _unwrittenData.size();    
      }        
      
      // Calculate the total number of data items that need to be written.
      if (rewriteRequired)
      {
          if (tc.isDebugEnabled()) Tr.debug(tc, "Section has '" + unwrittenDataSize + "' unwritten data items and '" + writtenDataSize + "' written data items to write");
          
          totalDataSize = unwrittenDataSize + writtenDataSize;
      }
      else
      {
          if (tc.isDebugEnabled()) Tr.debug(tc, "Section has '" + unwrittenDataSize + "' unwritten data items and '0' written data items to write");
          
          totalDataSize = unwrittenDataSize;
      }
  
      // As long as there are some to write then do so. Otherwise, this method is a no-op.
      if (totalDataSize > 0)
      {
        if (tc.isDebugEnabled()) Tr.debug(tc, "Writing section identity '" + _identity + "'");
  
        // Write the identity of this recoverable unit section
        logRecord.putInt(_identity);
  
        // Write the 'record type' field. Currently this is not used but is provided for future compatibility.
        // It would be used to distinguish between a 'normal' write and a 'delete' write. The latter would be used
        // to remove the recoverable unit section from the recovery log. Ignore this field for now.
        logRecord.putShort(RECORDTYPENORMAL);
  
        // Write the singleData flag
        logRecord.putBoolean(_singleData);
  
        // Write out the amount of data to be written
        logRecord.putInt(totalDataSize);
  
        if (rewriteRequired)
        {
          // Write the written data items to the buffer if a rewrite operation is being performed. 
          for( int i = 0; i < writtenDataSize; i++ )
          {            
            if (tc.isDebugEnabled()) Tr.debug(tc, "Writing written data item '" + i + "'");
            ((DataItem)_writtenData.get(i)).write(logRecord);
          }
        }
  
        // Write the unwritten data items to the buffer. Additionally, these must then be transferred 
        // to the written data items list.
        for( int i = 0; i < unwrittenDataSize; i++ )
        {
          if (tc.isDebugEnabled()) Tr.debug(tc, "Writing unwritten data item '" + i + "'");
  
          DataItem dataItem = (DataItem)_unwrittenData.get(i);
  
          dataItem.write(logRecord);
  
          _writtenData.add(dataItem);
        }
  
        // There can be no unwritten data items left after this method has run. Ensure that
        // we have a clear unwritten data item list.
        if (unwrittenDataSize > 0)
        {
          _unwrittenData.clear();
        }
      }
      else
      {
        if (tc.isDebugEnabled()) Tr.debug(tc, "RecoverableUnitSectionImpl '" + _identity + "' has no data to format");
      }
  
      try
      {
        _controlLock.releaseSharedLock(LOCK_REQUEST_ID_RUSI_FORMAT);
      }
      catch(NoSharedLockException exc)
      {
        FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoverableUnitSectionImpl.format", "670", this);
        if (tc.isEntryEnabled()) Tr.exit(tc, "format", "InternalLogException");
        throw new InternalLogException(exc);
      }
  
      if (tc.isEntryEnabled()) Tr.exit(tc, "format");
    }