code: private final int encodeIds(byte[] buffer, int offset) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "encodeIds");
  
      int idOffset = offset;
  
      // Write the JMF version number and Schema id for the header
      ArrayUtil.writeShort(buffer, idOffset, ((JMFMessage)headerPart.jmfPart).getJMFEncodingVersion());
      idOffset += ArrayUtil.SHORT_SIZE;
      ArrayUtil.writeLong(buffer, idOffset, headerPart.jmfPart.getEncodingSchema().getID());
      idOffset += ArrayUtil.LONG_SIZE;
  
      // Write the JMF version number and Schema id for the payload, if there is one
      if (payloadPart != null) {
        ArrayUtil.writeShort(buffer, idOffset, ((JMFMessage)payloadPart.jmfPart).getJMFEncodingVersion());
        idOffset += ArrayUtil.SHORT_SIZE;
        ArrayUtil.writeLong(buffer, idOffset, payloadPart.jmfPart.getEncodingSchema().getID());
        idOffset += ArrayUtil.LONG_SIZE;
      }
  
      // Otherwise we just write zeros to fill up the same space
      else {
        ArrayUtil.writeShort(buffer, idOffset, (short)0);
        idOffset += ArrayUtil.SHORT_SIZE;
        ArrayUtil.writeLong(buffer, idOffset, 0L);
        idOffset += ArrayUtil.LONG_SIZE;
  
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "encodeIds", Integer.valueOf(idOffset - offset));
      return idOffset - offset;
  
    }
docs: Encode the JMF version and schema ids into a byte array buffer.
  The buffer will be used when transmitting over the wire, hardening
  into a database and for any other need for 'serialization'
  
  @param buffer  The buffer to write the Ids into.
  @param offset  The offset in the buffer at which to start writing the Ids.
  
  @return the number of bytes written to the buffer.
  
  @exception MessageEncodeFailedException is thrown if the ids could not be written.