public final void write(PBSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
        SerializeWriter out = serializer.getWriter();

        Object[] array = (Object[]) object;
        
        if (object == null) {
            return;
        }
        
        int size = array.length;
        
        try
        {
        	if (fieldName == null)
            {
            	out.getCodedOutputStream().writeRawByte(com.jd.glowworm.asm.Type.ARRAY_OBJ);
            }
        	out.writeInt(size);
        	
            Class<?> preClazz = null;
            ObjectSerializer preWriter = null;
            
            for (int i = 0; i < size; ++i) {
                Object item = array[i];
                
                if (item == null)
                {
                	out.getCodedOutputStream().writeRawByte(1);
                }
                else
                {
                	out.getCodedOutputStream().writeRawByte(0);
                    Class<?> clazz = item.getClass();
                    
                    if (clazz == preClazz) {
                        preWriter.write(serializer, item, null, clazz);
                    } else {
                        preClazz = clazz;
                        preWriter = serializer.getObjectWriter(clazz);
                        
                        if (preWriter.getClass().getName().startsWith(ASMSerializerFactory.GenClassName_prefix))
    	                {
    	                	out.getCodedOutputStream().writeRawByte(com.jd.glowworm.asm.Type.OBJECT);
    	                	out.getCodedOutputStream().writeString(item.getClass().getName());
    	                }
                        
                        preWriter.write(serializer, item, null, clazz);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }