code: @Override
      public void writeMap(Map<Object, Object> map) {
  		//log.info("writeMap: {}", map);
          if (!checkWriteReference(map)) {
              storeReference(map);
              buf.put(AMF.TYPE_MIXED_ARRAY);
              int maxInt = -1;
              for (int i = 0; i < map.size(); i++) {
                  try {
                      if (!map.containsKey(i)) {
                          break;
                      }
                  } catch (ClassCastException err) {
                      // map has non-number keys
                      break;
                  }
                  maxInt = i;
              }
              buf.putInt(maxInt + 1);
              // TODO: Need to support an incoming key named length
              for (Map.Entry<Object, Object> entry : map.entrySet()) {
                  final String key = entry.getKey().toString();
      			//log.info("key: {} item: {}", key, entry.getValue());
                  if ("length".equals(key)) {
                      continue;
                  }
                  putString(key);
                  Serializer.serialize(this, entry.getValue());
              }
              if (maxInt >= 0) {
                  putString("length");
                  Serializer.serialize(this, maxInt + 1);
              }
              buf.put(AMF.END_OF_OBJECT_SEQUENCE);
          }
      }
docs: {@inheritDoc}