             output.writeByte(flags);
 
         if (body != null)
-            output.writeObject(body);
+            writeExternalBody(output);
 
         if (clientId != null && clientIdBytes == null)
             output.writeObject(clientId);

        }

        return result;
    }

    /**


        return flagsArray;
    }

    /**
     * @private
     */
    protected function writeExternalBody(output:IDataOutput):void
    {
        output.writeObject(body);
    }
}

}
