<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2005-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.messaging.channels.amfx
{

import flash.net.getClassByAlias;
import flash.utils.ByteArray;
import flash.utils.getDefinitionByName;
import flash.utils.IExternalizable;

import mx.logging.Log;
import mx.messaging.errors.ChannelError;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import mx.utils.HexDecoder;

[ResourceBundle("messaging")]

[ExcludeClass]

/**
 * Decodes an AMFX packet into an ActionScript Object graph.
 * Headers and the result body are accessed from the returned
 * AMFXResult.
 * @private
 */
public class AMFXDecoder
{
    //--------------------------------------------------------------------------
    //
    // Constructor
    // 
    //--------------------------------------------------------------------------

    public function AMFXDecoder()
    {
        super();
    }

    //--------------------------------------------------------------------------
    //
    // Class variables
    // 
    //--------------------------------------------------------------------------

	/**
	 *  @private
	 *  Storage for the resourceManager getter.
	 *  This gets initialized on first access,
	 *  not at static initialization time, in order to ensure
	 *  that the Singleton registry has already been initialized.
	 */
	private static var _resourceManager:IResourceManager;
	
	/**
	 *  @private
     *  A reference to the object which manages
     *  all of the application's localized resources.
     *  This is a singleton instance which implements
     *  the IResourceManager interface.
	 */
	private static function get resourceManager():IResourceManager
	{
		if (!_resourceManager)
			_resourceManager = ResourceManager.getInstance();

		return _resourceManager;
	}

    //--------------------------------------------------------------------------
    //
    // Public Methods
    // 
    //--------------------------------------------------------------------------
    
    public function decode(xml:XML):AMFXResult
    {
        if (xml)
        {
            var context:AMFXContext = new AMFXContext();
            context.log = Log.getLogger("mx.messaging.channels.amfx.AMFXDecoder");
            return decodePacket(xml, context);
        }
        else
        {
            return null;<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2005-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.messaging.channels.amfx
{

import flash.net.getClassByAlias;
import flash.utils.ByteArray;
import flash.utils.getDefinitionByName;
import flash.utils.IExternalizable;

import mx.logging.Log;
import mx.messaging.errors.ChannelError;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import mx.utils.HexDecoder;

[ResourceBundle("messaging")]

[ExcludeClass]

/**
 * Decodes an AMFX packet into an ActionScript Object graph.
 * Headers and the result body are accessed from the returned
 * AMFXResult.
 * @private
 */
public class AMFXDecoder
{
    //--------------------------------------------------------------------------
    //
    // Constructor
    // 
    //--------------------------------------------------------------------------

    public function AMFXDecoder()
    {
        super();
    }

    //--------------------------------------------------------------------------
    //
    // Class variables
    // 
    //--------------------------------------------------------------------------

	/**
	 *  @private
	 *  Storage for the resourceManager getter.
	 *  This gets initialized on first access,
	 *  not at static initialization time, in order to ensure
	 *  that the Singleton registry has already been initialized.
	 */
	private static var _resourceManager:IResourceManager;
	
	/**
	 *  @private
     *  A reference to the object which manages
     *  all of the application's localized resources.
     *  This is a singleton instance which implements
     *  the IResourceManager interface.
	 */
	private static function get resourceManager():IResourceManager
	{
		if (!_resourceManager)
			_resourceManager = ResourceManager.getInstance();

		return _resourceManager;
	}

    //--------------------------------------------------------------------------
    //
    // Public Methods
    // 
    //--------------------------------------------------------------------------
    
    public function decode(xml:XML):AMFXResult
    {
        if (xml)
        {
            var context:AMFXContext = new AMFXContext();
            context.log = Log.getLogger("mx.messaging.channels.amfx.AMFXDecoder");
            XML.ignoreWhitespace = false;
            return decodePacket(xml, context);
        }
        else
        {
            return null;
{'fraction_non_alphanumeric': 0.28952622980577236, 'fraction_numerical': 0.0029043383554184063, 'mean_word_length': 1.2920133111480865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4670940', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1200, 'n_words': 356}