docs: private void writePendingToFile() throws java.io.IOException, InternalLogException, LogIncompatibleException
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "writePendingToFile");
  
          synchronized (_pendingWriteList)
          {
              LogRecord[] records = (LogRecord[]) _pendingWriteList.toArray(new LogRecord[0]);
  
              // Don't use vectored IO unless we're told to.
              if (!Boolean.getBoolean("com.ibm.ws.recoverylog.spi.UseVectoredIO"))
              {
                  // Put the file header at the front of the list
                  ByteBuffer header = (ByteBuffer) _fileBuffer.duplicate().position(0).limit(_logFileHeader.length());
                  _fileChannel.write(header, 0);
  
                  // Write the remainder of the list
                  for (int i = 0; i < records.length; i++)
                  {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "Performing write at position " + records[i].absolutePosition());
                      _fileChannel.write((ByteBuffer) records[i]._buffer.flip(), records[i].absolutePosition());
                  }
              }
              else
              {
                  // Sort the records into ascending order based on their absolute
                  // position in the file.  We're going to try and keep the disk
                  // moving forward.
                  Arrays.sort(records, _recordComparator);
  
                  // Now separate the records into two arrays:
                  //   o ByteBuffers of data
                  //   o Absolute File positions
                  ByteBuffer[] buffers = new ByteBuffer[records.length + 1];
                  int[] positions = new int[records.length + 1];
  
                  for (int i = 0; i < records.length; i++)
                  {
                      buffers[i + 1] = (ByteBuffer) records[i]._buffer.flip();
                      positions[i + 1] = records[i].absolutePosition();
                  }
  
                  // Put the file header at the front of the list
                  buffers[0] = (ByteBuffer) _fileBuffer.duplicate().position(0).limit(_logFileHeader.length());
                  positions[0] = 0;
  
                  // Here's where we go through the list and attempt to write
                  // batches of adjacent records using vectored I/O.
                  int idx = 0;
                  while (idx < buffers.length)
                  {
                      int min = idx;
                      int max = idx;
  
                      // Somewhere in the middle
                      while (max <= (buffers.length - 2))
                      {
                          if (positions[max + 1] == (positions[max] + buffers[max].remaining()))
                              max++;
                      }
  
                      // Do the actual writes                    
                      _fileChannel.position(positions[min]);
                      _fileChannel.write(buffers, min, (max - min + 1));
  
                      // Go back and find the next batch
                      idx = max + 1;
                  }
              }
  
              // Cleanup the pending write list for the next force
              _pendingWriteList.clear();
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "writePendingToFile");
      }