docs: private final DataSlice encodeHeaderPartToSlice(JsMsgPart jsPart) throws MessageEncodeFailedException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "encodeHeaderPartToSlice", jsPart);
  
      // We hope that it is already encoded so we can just get it from JMF.....
      DataSlice slice = ((JMFMessage)jsPart.jmfPart).getAssembledContent();
  
      // ... if not, then we have to encode it now
      if (slice == null) {
        byte[] buff;
  
        // We need to ensure noone updates any vital aspects of the message part
        // between the calls to getEncodedLength() and toByteArray()       d364050
        synchronized (getPartLockArtefact(jsPart)) {
          buff = encodePart(jsPart);
        }
        slice = new DataSlice(buff, 0, buff.length);
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "encodeHeaderPartToSlice", slice);
      return slice;
    }