code: private void encodeMapBody(StringBuffer result, JsJmsMapMessage msg) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeMapBody");
      // Internal method to get the map as a Map
      try {
        Map<String, Object> body = ((JsJmsMapMessageImpl)msg).getBodyMap();
        if (body.size() > 0) {
          result.append('~');
          Set<Map.Entry<String, Object>> entries = body.entrySet();
          boolean first = true;
          for (Iterator<Map.Entry<String, Object>> i = entries.iterator(); i.hasNext(); ) {
            Map.Entry<String, Object> entry = i.next();
            encodePair(result, entry.getKey(), entry.getValue(), first);
            first = false;
          }
        }
      }
      catch (UnsupportedEncodingException e) {
        FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.WebJsJmsMessageEncoderImpl.encodeMapBody", "269");
        // Just treat it as null.
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeMapBody");
    }
docs: Encode a map message