protected void writeArbitraryObject(Object object,Serializer serializer){
  log.debug("writeObject");
  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);
  }
  for (  Field field : objectClass.getFields()) {
    String fieldName=field.getName();
    log.debug("Field: {} class: {}",field,objectClass);
    if (!serializeField(serializer,objectClass,fieldName,field,null)) {
      continue;
    }
    Object value;
    try {
      value=field.get(object);
    }
 catch (    IllegalAccessException err) {
      continue;
    }
    putString(buf,fieldName);
    serializer.serialize(this,field,null,object,value);
  }
  buf.put((byte)0x00);
  buf.put((byte)0x00);
  buf.put(AMF.TYPE_END_OF_OBJECT);
}

protected void writeArbitraryObject ( Object object , Serializer serializer ) { log . debug ( "writeObject" ) ; 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 ) ; } for ( Field field : objectClass . getFields ( ) ) { String fieldName = field . getName ( ) ; log . debug ( "Field: {} class: {}" , field , objectClass ) ; if ( ! serializeField ( serializer , objectClass , fieldName , field , null ) ) { continue ; } Object value ; try { value = field . get ( object ) ; } catch ( IllegalAccessException err ) { continue ; } putString ( buf , fieldName ) ; serializer . serialize ( this , field , null , object , value ) ; } buf . put ( ( byte ) 0x00 ) ; buf . put ( ( byte ) 0x00 ) ; buf . put ( AMF . TYPE_END_OF_OBJECT ) ; }
writes an arbitrary object to the output .
