docs: static void sendSchemas(CommsConnection conn, JMFSchema[] schemas)
        throws SIConnectionLostException, SIConnectionUnavailableException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendSchemas", conn);
  
      // Check if the recepient has all the schemas needed to decode the message.
      SchemaSet ids = (SchemaSet)conn.getSchemaSet();
      if (ids == null) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "getSchemaSet() returned null for CommsConnection: " + conn);
        throw new IllegalStateException("CommsConnection returned null SchemaSet");
      }
  
      JMFSchema[] missing = new JMFSchema[schemas.length];
      int count = 0;
      for (int i = 0; i < schemas.length; i++) {
        if (!ids.contains(schemas[i].getLongID()))
          missing[count++] = schemas[i];
      }
  
      // Send any missing schemas
      if (count > 0) {
        conn.sendMFPSchema(makeSchemaDefinitionList(missing, count));
        // Update the list
        for (int i = 0; i < count; i++)
          ids.add(missing[i].getLongID());
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSchemas");
    }
  
    //take an encoded list of schema IDs and return the corresponding encoded list of schemas
    static byte[] getEncodedSchemataByEncodedIDs(byte[] encodedSchemaIDs) {
      //double check that there are ids to decode
      if(encodedSchemaIDs != null && encodedSchemaIDs.length >= 8){
        //work out how many there are
        int numSchemas = encodedSchemaIDs.length / 8;
        long[] schemaIDs = new long[numSchemas];
        int offset = 0;
        //decode each one
        for(int i=0; i<numSchemas; i++){
          schemaIDs[i] = ArrayUtil.readLong(encodedSchemaIDs, offset);
          offset += 8;
        }
        //get the encoded schemas
        return getEncodedSchemataBySchemaIDs(schemaIDs);
      }
      else{
        return new byte[0];
      }
    }
  
    //get an encoded list of schemas from a list of schema IDs
    static byte[] getEncodedSchemataBySchemaIDs(long[] schemaIDs) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getEncodedSchemataBySchemaIDs", schemaIDs);
  
      JMFSchema[] temp = new JMFSchema[schemaIDs.length];
      int j = 0;
  
      //get each one from the registry
      for (int i = 0; i < schemaIDs.length; i++) {
        JMFSchema schema = JSRegistry.instance.retrieve(schemaIDs[i]);
        if (schema == null) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unable to retrieve message schema "+schemaIDs[i]);
          MessageDecodeFailedException e = new MessageDecodeFailedException("No schema registered for schema id "+schemaIDs[i]);
          FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.SchemaManager.getEncodedSchemasBySchemaIDs", "281");
        }
        else{
          temp[j++] = schema;
        }
      }
  
      JMFSchema[] found = new JMFSchema[j];
      System.arraycopy(temp,0,found,0,j);
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getEncodedSchemataBySchemaIDs");
  
      //encode the list and return it
      return makeSchemaDefinitionList(found, j);
    }
  
    /*
     * Helper methods
     */
  
    // Create the encoded list of schema ids
    private static byte[] makeSchemaIdList(JMFSchema[] schemas) {
      Coder coder = new Coder(ArrayUtil.LONG_SIZE * schemas.length, schemas.length);
      for (int i = 0; i < coder.count; i++) {
        ArrayUtil.writeLong(coder.buffer, coder.offset, schemas[i].getID());
        coder.offset += ArrayUtil.LONG_SIZE;
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Encoding " + coder.count + " schema ids for handshake");
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.bytes(tc, coder.buffer, Coder.HDR_LENGTH);
      return coder.buffer;
    }
  
    // Create an initial Set of incoming schema ids
    private static SchemaSet makeSchemaIdSet(Coder coder) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Decoding " + coder.count + "schema ids from handshake");
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.bytes(tc, coder.buffer, Coder.HDR_LENGTH);
  
      SchemaSet result = new SchemaSet();
      for (int i = 0; i < coder.count; i++) {
        long id = ArrayUtil.readLong(coder.buffer, coder.offset);
        coder.offset += ArrayUtil.LONG_SIZE;
        result.add(Long.valueOf(id));
      }
      return result;
    }
  
    // Create the encoded list of schema definitions
    private static byte[] makeSchemaDefinitionList(JMFSchema[] schemas, int count) {
      // Calculate the buffer size needed to encode all the schema defintions
      int length = 0;
      for (int i = 0; i < count; i++)
        length += ArrayUtil.INT_SIZE + schemas[i].toByteArray().length;
  
      // And encode them
      Coder coder = new Coder(length, count);
      for (int i = 0; i < coder.count; i++) {
        byte[] b = schemas[i].toByteArray();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "   Encoded Schema "+ debugSchema(schemas[i]) + " for transmission");
        ArrayUtil.writeInt(coder.buffer, coder.offset, b.length);
        coder.offset += ArrayUtil.INT_SIZE;
        System.arraycopy(b, 0, coder.buffer, coder.offset, b.length);
        coder.offset += b.length;
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Encoding " + coder.count + "new schema definitions");
      return coder.buffer;
    }