docs: public synchronized short getCommandCompletionCode(int expectedSegmentType)
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCommandCompletionCode",
                                             new Object[] {""+expectedSegmentType});
  
        checkReleased();
  
        short result = -1;
        if (receivedData != null)
        {
           // First see what the segment returned was
           int receivedDataSegmentType = getReceivedDataSegmentType();
  
           // If it matches what we expect, the there was no exception
           if (receivedDataSegmentType == expectedSegmentType)
           {
              result = CommsConstants.SI_NO_EXCEPTION;
           }
           else if (receivedDataSegmentType == JFapChannelConstants.SEG_EXCEPTION)
           {
              getShort();                     // Skip over the exception count
              result = getShort();
  
              // Ensure we rewind the buffer (as we are only peeking a look here)
              receivedBuffer.rewind();
           }
           else
           {
              // Get the segment types in decimal and hex for ease of use
              String expected = expectedSegmentType + " (0x" + Integer.toHexString(expectedSegmentType).toUpperCase() + ")";
              String actual = receivedDataSegmentType + " (0x" + Integer.toHexString(receivedDataSegmentType).toUpperCase() + ")";
  
              throw new SIErrorException(
                 TraceNLS.getFormattedMessage(CommsConstants.MSG_BUNDLE,
                                              "JFAP_SEG_MISMATCH_EXCEPTION_SICO1006",
                                              new Object[] {expected, actual}, null)
              );
           }
        }
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getCommandCompletionCode", ""+result);
        return result;
     }