docs: public void write(ByteBuffer fileBuffer, boolean maintainPosition) throws InternalLogException, LogIncompatibleException
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "write", new Object[] { fileBuffer, new Boolean(maintainPosition), this });
  
          if (!_compatible)
          {
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "write", "LogIncompatibleException");
              throw new LogIncompatibleException();
          }
  
          if (_status == STATUS_INVALID)
          {
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "write", "LogHeaderInvalid - throwing InternalLogException");
              throw new InternalLogException(null);
          }
  
          try
          {
              int startPosition = 0;
  
              // If required, record the current position so that it can
              // be restored after updating the header.
              if (maintainPosition)
              {
                  startPosition = fileBuffer.position();
              }
  
              // Move the file's position back to the start of the
              // file so that we write the header in the correct 
              // location.
              fileBuffer.position(0);
  
              // Write the length of the header.
              fileBuffer.putInt(headerSize() +
                                _serverNameBytes.length +
                                _serviceNameBytes.length +
                                _logNameBytes.length);
  
              // Write the "MAGIC" number at the top of the header. This is to help
              // identify the file as a WebSphere recovery log file.
              fileBuffer.put(LogFileHeader.MAGIC_NUMBER);
  
              // Write the version number of the RLS implementation.
              fileBuffer.putInt(Configuration.RLS_VERSION);
  
              // Status field
              fileBuffer.putInt(_status);
  
              // Date of file creation/update
              fileBuffer.putLong(_date);
  
              // Sequence Number of first entry
              fileBuffer.putLong(_firstRecordSequenceNumber);
  
              // Server Name
              fileBuffer.putInt(_serverNameBytes.length);
              fileBuffer.put(_serverNameBytes);
  
              // Service Name
              fileBuffer.putInt(_serviceNameBytes.length);
              fileBuffer.put(_serviceNameBytes);
  
              // Service version
              fileBuffer.putInt(_serviceVersion);
  
              // Log Name
              fileBuffer.putInt(_logNameBytes.length);
              fileBuffer.put(_logNameBytes);
  
              // calculate length of the variable data
              int varLength = 0;
              if (_variableFieldData != null && _useVariableFieldHeader)
              {
                  varLength += VARIABLE_FIELD_HEADER.length; // not included until we have variable data otherwise header may grow before a keypoint
                  varLength += RLSUtils.INT_SIZE; // the length of the variable data
                  varLength += _variableFieldData.length;
              }
  
              // Length of Service Data
              if (_serviceData != null)
              {
                  varLength += _serviceData.length;
              }
  
              // write variable data length
              fileBuffer.putInt(varLength);
  
              if (_variableFieldData != null && _useVariableFieldHeader)
              {
                  fileBuffer.put(VARIABLE_FIELD_HEADER);
  
                  // write RLS variable field
                  fileBuffer.putInt(_variableFieldData.length);
                  fileBuffer.put(_variableFieldData);
              }
  
              // write service data
              if (_serviceData != null)
              {
                  fileBuffer.put(_serviceData);
              }
  
              // Date Of Creation (re-written to provide validation of previous information)
              fileBuffer.putLong(_date);
  
              // Sequence Number of first entry (re-written to provide validation of previous information)
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Writing FRSN " + _firstRecordSequenceNumber + " at position " + fileBuffer.position() + " in log file " + _logName);
              fileBuffer.putLong(_firstRecordSequenceNumber);
  
              // Reset the file position if required
              if (maintainPosition)
              {
                  fileBuffer.position(startPosition);
              }
          } catch (BufferUnderflowException exc)
          {
              FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogFileHeader.write", "449", this);
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "write", "InternalLogException");
              throw new InternalLogException(exc);
          } catch (Throwable exc)
          {
              FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogFileHeader.write", "455", this);
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "write", "InternalLogException");
              throw new InternalLogException(exc);
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "write");
      }