code: @SuppressWarnings({ "rawtypes" })
      @Override
      public void writeObject(Object object) {
          if (!checkWriteReference(object)) {
              storeReference(object);
              // create new map out of bean properties
              BeanMap beanMap = new BeanMap(object);
              // set of bean attributes
              Set attrs = beanMap.keySet();
              log.trace("Bean map keys: {}", attrs);
              if (attrs.size() == 0 || (attrs.size() == 1 && beanMap.containsKey("class"))) {
                  // beanMap is empty or can only access "class" attribute, skip it
                  writeArbitraryObject(object);
                  return;
              }
              // write out either start of object marker for class name or "empty" start of object marker
              Class<?> objectClass = object.getClass();
              if (!objectClass.isAnnotationPresent(Anonymous.class)) {
                  buf.put(AMF.TYPE_CLASS_OBJECT);
                  putString(buf, Serializer.getClassName(objectClass));
              } else {
                  buf.put(AMF.TYPE_OBJECT);
              }
              if (object instanceof ICustomSerializable) {
                  ((ICustomSerializable) object).serialize(this);
                  buf.put(AMF.END_OF_OBJECT_SEQUENCE);
                  return;
              }
              // Iterate thru entries and write out property names with separators
              for (Object key : attrs) {
                  String fieldName = key.toString();
                  log.debug("Field name: {} class: {}", fieldName, objectClass);
                  Field field = getField(objectClass, fieldName);
                  Method getter = getGetter(objectClass, beanMap, fieldName);
                  // Check if the Field corresponding to the getter/setter pair is transient
                  if (!serializeField(objectClass, fieldName, field, getter)) {
                      continue;
                  }
                  putString(buf, fieldName);
                  Serializer.serialize(this, field, getter, object, beanMap.get(key));
              }
              // write out end of object mark
              buf.put(AMF.END_OF_OBJECT_SEQUENCE);
          }
      }
docs: {@inheritDoc}