code: function amfXEncodeOne(rules, o) {
  //    console.log('amfXEncodeOne type',o,amfType(o),rules[amfType(o)]);
      var f = rules[amfType(o)];
      if (f) return f(o);
      throw new Error('Unsupported type for encoding!');
  }
docs: Encode one AMF value according to rules
  @param rules
  @param o
  @returns {*}