docs: private WsByteBuffer[] marshallReuseHeaders(WsByteBuffer[] inBuffers) {
          final boolean bTrace = TraceComponent.isAnyTracingEnabled();
          WsByteBuffer[] src = inBuffers;
          if (bTrace && tc.isDebugEnabled()) {
              Tr.debug(tc, "Marshalling headers and re-using buffers, change="
                           + this.headerChangeCount + ", add=" + this.headerAddCount
                           + ", src=" + src);
          }
  
          HeaderElement elem = this.hdrSequence;
          WsByteBuffer[] buffers = src;
          int size = this.parseIndex + (0 < this.headerAddCount ? 2 : 1);
          int output = 0;
          int input = 0;
          if (null == src || 0 == src.length) {
              // the first line has not changed
              buffers = new WsByteBuffer[size];
          } else {
              // first line has been remarshalled. We need to update the parse
              // buffers to trim off the first line data. Dump any first line data
              // from the cache and flip the last buffer.
              src = flushCache(src);
              src[src.length - 1].flip();
  
              int firstHeaderBuffer = elem.getLastCRLFBufferIndex();
              for (int i = 0; i < firstHeaderBuffer; i++) {
                  if (bTrace && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Trimming first line data from " + this.parseBuffers[i]);
                  }
                  this.parseBuffersStartPos[i] = this.parseBuffers[i].limit();
              }
              int firstHeaderPos = elem.getLastCRLFPosition() + (elem.isLastCRLFaCR() ? 2 : 1);
              if (bTrace && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Setting first buffer with headers pos to " + firstHeaderPos);
              }
              this.parseBuffersStartPos[firstHeaderBuffer] = firstHeaderPos;
              size = size - firstHeaderBuffer + src.length;
              buffers = new WsByteBuffer[size];
              System.arraycopy(src, 0, buffers, 0, src.length);
              output = src.length;
              input = firstHeaderBuffer;
          }
  
          // handle any changed/removed headers
          if (0 < this.headerChangeCount) {
              elem = this.hdrSequence;
              for (int i = 0; i < this.headerChangeCount && null != elem && -1 != elem.getLastCRLFBufferIndex();) {
                  if (elem.wasRemoved()) {
                      eraseValue(elem);
                      i++;
                  } else if (elem.wasChanged()) {
                      overlayValue(elem);
                      i++;
                  }
                  elem = elem.nextSequence;
              }
          }
  
          // copy the existing parse buffers to the output list, fixing positions
          // as we go, up until the last header buffer
          for (; input < this.parseIndex; input++, output++) {
              buffers[output] = this.parseBuffers[input];
              buffers[output].position(this.parseBuffersStartPos[input]);
              if (bTrace && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Copying existing parse buffer: " + buffers[output]);
              }
          }
  
          // now slice the last header buffer. If no additional headers are there,
          // then leave the double EOL, otherwise trim one of them off
          int endPos = this.eohPosition;
          if (0 < this.headerAddCount) {
              endPos = this.lastCRLFPosition + 1;
              if (this.lastCRLFisCR) {
                  endPos++;
              }
          }
  
          WsByteBuffer buffer = this.parseBuffers[input];
          int pos = buffer.position();
          int lim = buffer.limit();
          buffer.position(this.parseBuffersStartPos[input]);
          buffer.limit(endPos);
          buffers[output] = buffer.slice();
          addToCreatedBuffer(buffers[output]);
          buffer.limit(lim);
          buffer.position(pos);
          if (bTrace && tc.isDebugEnabled()) {
              Tr.debug(tc, "Sliced last header buffer: " + buffers[output]);
          }
  
          // check whether we need to marshall any new headers
          if (0 < this.headerAddCount) {
              buffers = marshallAddedHeaders(buffers, ++output);
          }
  
          return buffers;
      }