code: @Override
      public void writeMap(Collection<?> array) {
          writeAMF3();
          buf.put(AMF3.TYPE_ARRAY);
          if (hasReference(array)) {
              putInteger(getReferenceId(array) << 1);
              return;
          }
          storeReference(array);
          // TODO: we could optimize this by storing the first integer
          //       keys after the key-value pairs
          amf3_mode += 1;
          putInteger(1);
          int idx = 0;
          for (Object item : array) {
              if (item != null) {
                  putString(String.valueOf(idx));
                  Serializer.serialize(this, item);
              }
              idx++;
          }
          amf3_mode -= 1;
          putString("");
      }
docs: {@inheritDoc}