docs: private void parsePrimaryHeader(WsByteBuffer contextBuffer)
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "parsePrimaryHeader", contextBuffer);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, contextBuffer, "contextBuffer");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, unparsedPrimaryHeader, "unparsedPrimaryHeader");
  
        int initialPrimaryHeaderPosition = unparsedPrimaryHeader.position();
        WsByteBuffer parseHeaderBuffer = readData(contextBuffer, unparsedPrimaryHeader);
  
        if (parseHeaderBuffer != null)
        {
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "parse header buffer not null");
  
           short eyecatcher = parseHeaderBuffer.getShort();
           if (eyecatcher != (short)0xBEEF)
           {
              // bad eyecatcher
              state = STATE_ERROR;
              throwable = new SIConnectionLostException(nls.getFormattedMessage("TRANSPARSER_PROTOCOLERROR_SICJ0053", new Object[] {connection.remoteHostAddress, connection.chainName}, "TRANSPARSER_PROTOCOLERROR_SICJ0053"));   // D226223
              // This FFDC was generated because our peer sent us an invalid eyecatcher.
              FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_01, getFormattedBytes(contextBuffer));  // D267629
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "bad eyecatcer (as short): "+eyecatcher);
           }
           else
           {
              primaryHeaderFields.segmentLength = parseHeaderBuffer.getInt();
              if (primaryHeaderFields.segmentLength < 0) primaryHeaderFields.segmentLength += 4294967296L;
  
              // Reject lengths greater than our maximum transmission length.
              if (primaryHeaderFields.segmentLength > connection.getMaxTransmissionSize())
              {
                 state = STATE_ERROR;
                 throwable = new SIConnectionLostException(nls.getFormattedMessage("TRANSPARSER_PROTOCOLERROR_SICJ0053", new Object[] {connection.remoteHostAddress, connection.chainName}, "TRANSPARSER_PROTOCOLERROR_SICJ0053"));   // D226223
                 // This FFDC was generated because our peer has exceeded the maximum segment size
                 // that was agreed at handshake time.
                 FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_02, getFormattedBytes(contextBuffer));  // D267629
                 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "max transmission size exceeded");
              }
              else
              {
                 transmissionPayloadRemaining = primaryHeaderFields.segmentLength - JFapChannelConstants.SIZEOF_PRIMARY_HEADER;
                 short flags = parseHeaderBuffer.getShort();
                 primaryHeaderFields.priority = flags & 0x000F;
                 primaryHeaderFields.isPooled = (flags & 0x1000) == 0x1000;
                 primaryHeaderFields.isExchange = (flags & 0x4000) == 0x4000;            // D190023
                 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "flags: "+flags);
                 primaryHeaderFields.packetNumber = parseHeaderBuffer.get();
                 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "packet number: "+primaryHeaderFields.packetNumber+" expected: "+expectedPacketNumber);
  
                
                 if (primaryHeaderFields.packetNumber != expectedPacketNumber)
                 {
                    state = STATE_ERROR;
                    throwable = new SIConnectionLostException(nls.getFormattedMessage("TRANSPARSER_PROTOCOLERROR_SICJ0053", new Object[] {connection.remoteHostAddress, connection.chainName}, "TRANSPARSER_PROTOCOLERROR_SICJ0053"));   // D226223
                    // This FFDC was generated because our peer sent us a transmission containing
                    // a sequence number that did not match the one we expected.
                    final Object[] ffdcData = new Object[] {
                          "expected packet number="+expectedPacketNumber,
                          "received packet number="+primaryHeaderFields.packetNumber,
                          getFormattedBytes(contextBuffer)
                    };
                    FFDCFilter.processException(throwable,
                                                "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser",
                                                JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_03,
                                                ffdcData);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "sequence number mis-match - expected:"+expectedPacketNumber+" got:"+primaryHeaderFields.packetNumber);
                 }
                 else
                 {
                    ++expectedPacketNumber;
                    primaryHeaderFields.segmentType = parseHeaderBuffer.get();
                    if (primaryHeaderFields.segmentType < 0) primaryHeaderFields.segmentType += 256;
  
                    transmissionLayout = JFapChannelConstants.segmentToLayout(primaryHeaderFields.segmentType);
  
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "layout = "+transmissionLayout);
                    if (transmissionLayout == JFapChannelConstants.XMIT_PRIMARY_ONLY)
                    {
                       transmissionPayloadDataLength = primaryHeaderFields.segmentLength - JFapChannelConstants.SIZEOF_PRIMARY_HEADER;
                       state = STATE_PARSING_PRIMARY_ONLY_PAYLOAD;
                    }
                    else if ( (transmissionLayout == JFapChannelConstants.XMIT_CONVERSATION) ||
                              (transmissionLayout == JFapChannelConstants.XMIT_SEGMENT_START) ||
                              (transmissionLayout == JFapChannelConstants.XMIT_SEGMENT_MIDDLE) ||
                              (transmissionLayout == JFapChannelConstants.XMIT_SEGMENT_END))
                    {
                       state = STATE_PARSING_CONVERSATION_HEADER;
                    }
                    else if (transmissionLayout == JFapChannelConstants.XMIT_LAYOUT_UNKNOWN)
                    {
                       throwable = new SIErrorException(nls.getFormattedMessage("TRANSPARSER_INTERNAL_SICJ0054", null, "TRANSPARSER_INTERNAL_SICJ0054")); // D226223
                       // This FFDC was generated because the segment type of the transmission doesn't match any of
                       // the segment types that we know the layout for.
                       FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_04, getFormattedBytes(contextBuffer));  // D267629
                       state = STATE_ERROR;
                       if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "invalid layout");
                    }
                    else
                    {
                       throwable = new SIErrorException(nls.getFormattedMessage("TRANSPARSER_INTERNAL_SICJ0054", null, "TRANSPARSER_INTERNAL_SICJ0054")); // D226223
                       // This FFDC was generated because the JFapChannelConstants.segmentToLayout method
                       // returned a transmission layout we didn't expect.
                       FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_05, getFormattedBytes(contextBuffer));  // D267629
                       state = STATE_ERROR;
                       if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "JFapChannelConstants.segmentToLayout method returned unknown enumeration value");
                    }
                 }
              }
           }
        }
        else
        {
           // Optimisation for early rejection of bad eyecatcher
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, unparsedPrimaryHeader, "unparsedPrimaryHEader");
           int unparsedPrimaryHeaderPosition = unparsedPrimaryHeader.position();
           if ((initialPrimaryHeaderPosition < JFapChannelConstants.SIZEOF_EYECATCHER) &&
               (unparsedPrimaryHeaderPosition > initialPrimaryHeaderPosition))
           {
              int eyecatcherPresent = unparsedPrimaryHeaderPosition - initialPrimaryHeaderPosition;
              if (eyecatcherPresent > JFapChannelConstants.SIZEOF_EYECATCHER) eyecatcherPresent = JFapChannelConstants.SIZEOF_EYECATCHER;
              int eyecatcherOffset = initialPrimaryHeaderPosition;
  
              unparsedPrimaryHeader.position(eyecatcherOffset);
              boolean reject = false;
              for (int i=eyecatcherOffset; (i < eyecatcherPresent) && (!reject); ++i)
              {
                 reject = unparsedPrimaryHeader.get() != JFapChannelConstants.EYECATCHER_AS_BYTES[i];
              }
  
              if (reject)
              {
                 throwable = new SIConnectionLostException(nls.getFormattedMessage("TRANSPARSER_PROTOCOLERROR_SICJ0053", new Object[] {connection.remoteHostAddress, connection.chainName}, "TRANSPARSER_PROTOCOLERROR_SICJ0053"));   // D226223
                 // This FFDC was generated because our peer sent us bad eyecathcer data.
                 FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSEPRIMHDR_06, getFormattedBytes(contextBuffer));  // D267629
                 state = STATE_ERROR;
                 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "invalid eyecatcher");
              }
              else
              {
                 unparsedPrimaryHeader.position(unparsedPrimaryHeaderPosition);
              }
           }
  
           if (state != STATE_ERROR)
           {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "need more data");
              needMoreData = true;
           }
        }
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "parsePrimaryHeader");
     }