• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運轉(zhuǎn),開心的工作
            簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            中英文版本的amf3規(guī)格說明

            Posted on 2010-01-26 14:10 S.l.e!ep.¢% 閱讀(3012) 評論(0)  編輯 收藏 引用 所屬分類: A·M·F·3

            中英文版本的amf3規(guī)格說明 收藏
            ?

            譯者申明:由于水平有限,難免有錯誤,請指正。聯(lián)系方式 QQ:457873255,TEL:13570497022

            ?

            ?

            Adobe Systems Inc.

            AMF 3 Specification

            Category: ActionScript Serialization 類別:AS序列化

            ?

            Action Message Format -- AMF 3

            Copyright Notice

            Copyright (c) Adobe Systems Inc. (2002-2006). All Rights Reserved.

            ?

            Abstract 概覽

            Action Message Format (AMF) is a compact binary format that is used to serialize ActionScript object graphs. Once serialized an AMF encoded object graph may be used to persist and retrieve the public state of an application across sessions or allow two endpoints to communicate through the exchange of strongly typed data.

            AMF(Action Message Format 動作信息格式)是用來序列化AS(ActionScript 動作腳本)實例對象(object graphs)的壓縮的二進(jìn)制格式。序列化的AMF編碼的實例對象可用來持久化,并且在不同的會話中獲得應(yīng)用的公共狀態(tài),或者允許在兩個端點(比如客戶端和服務(wù)器端 --譯者注)通過強(qiáng)類型數(shù)據(jù)交換進(jìn)行通信。

            ?

            AMF was introduced in Flash Player 6 in 2001 and remained unchanged with the introduction of ActionScript 2.0 in Flash Player 7 and with the release of Flash Player 8. This version of AMF is referred to as AMF 0 (See [AMF0]). In Flash Player 9, Action Script 3.0 was introduced along with a new ActionScript Virtual Machine (AVM+) - the new data types and language features made possible by these improvements prompted AMF to be updated.? Given the opportunity to release a new version of AMF, several optimizations were also made to the encoding format to remove redundant information from serialized data. This specification defines this updated version of AMF, namely AMF 3.

            AMF引進(jìn)于2001年的FlashPlayer6,并且在引入AS2.0的FlashPlayer7和FlashPlayer8中沒有改變的保留了。這個版本的AMF參考于AMF0(查閱[AMF0])。在FlashPlayer9中,AS3.0同新的AS虛擬機(jī)(AVM+)一起被引進(jìn)—新的數(shù)據(jù)類型和語言特性的改進(jìn)致使AMF升級成為可能,給了一個發(fā)布新的AMF版本的機(jī)會,新版本的AMF在序列化數(shù)據(jù)的時候做了一些優(yōu)化,使得編碼格式去除了一些冗余信息。升級后的AMF版本便是AMF3。

            ?

            Table of Contents 目錄(略)

            ?

            1 Introduction 介紹

            ?

            1.1 Purpose 目的

            Action Message Format (AMF) is a compact binary format that is used to serialize ActionScript object graphs. Once serialized an AMF encoded object graph may be used to persist and retrieve the public state of an application across sessions or allow two endpoints to communicate through the exchange of strongly typed data. (譯者注:之前有翻譯)

            The first version of AMF, referred to as AMF 0, supports sending complex objects by reference which helps to avoid sending redundant instances in an object graph.

            第一個版本的AMF,即AMF0,支持在避免了在對象圖中發(fā)送冗余的實例的通過引用發(fā)送復(fù)雜的對象。

            It also allows endpoints to restore object relationships and support circular references while avoiding problems such as infinite recursion during serialization.

            他也允許端點存儲對象關(guān)系,并且支持在避免問題--如在序列化時無窮的遞歸--的情況下的循環(huán)引用。

            A new version of AMF, referred to as AMF 3 to coincide with the release of ActionScript 3.0, improves on AMF 0 by sending object traits and strings by reference in addition to object instances.

            新版本的AMF,即AMF3,與AS3.0版本保持一致,在通過引用發(fā)送除對象實例外的對象特性和字符串做了改進(jìn)。

            AMF 3 also supports some new data types introduced in ActionScript 3.0.

            AMF3也支持在AS3.0中的一些新的數(shù)據(jù)類型。

            ?

            1.2 Notational Conventions 標(biāo)記轉(zhuǎn)換

            1.2.1 Augmented BNF 增強(qiáng)的BNF

            Type definitions in this specification use Augmented Backus-Naur Form (ABNF) syntax [RFC2234].在這個規(guī)格中類型定義使用參數(shù)化的巴克斯范式(ABNF)語法[RFC2234]。

            (譯者注:

            BNF is a formal meta-syntax used to express context-free Grammars. BNF is one of the most commonly used meta-syntactic notation s for specifying the syntax of programming languages, command sets, PDUs, and similar things. However, pure BNF is rather limited, so the two variations EBNF and ABNF have become more popular.)

            ?

            The reader should be familiar with this notation before reading this document.

            讀者在閱讀這個文檔之前應(yīng)該熟悉這個注解。

            ?

            1.3 Basic Rules 基本規(guī)則

            Throughout this document bytes are assumed to be octets, or 8-bits.

            這個文檔的字節(jié)是8位的。

            U8
            ?An unsigned byte (8-bits, an octet)

            無符號字節(jié)(8位,一個8位字節(jié))
            ?
            U16
            ?An unsigned 16-bit integer in big endian??? (network) byte order

            在網(wǎng)絡(luò)中的字節(jié)順序中的無符號的占用16個二進(jìn)制位的整數(shù)
            ?
            U32
            ?An unsigned 32-bit integer in big endian (network) byte order

            在網(wǎng)絡(luò)中的字節(jié)順序中的無符號的占用32個二進(jìn)制位的整數(shù)
            ?
            DOUBLE
            ?8 byte IEEE-754 double precision floating point value in network byte order (sign bit in low memory).

            在網(wǎng)絡(luò)中的字節(jié)循序的(符號位在低存儲)8字節(jié)的IEEE-754雙精度浮點數(shù)
            ?
            MB
            ?A megabyte or 1048576 bytes.

            兆字節(jié)
            ?
            ?

            ?

            More complicated data type rules require special treatment which is outlined below.

            更多的復(fù)雜的數(shù)據(jù)類型規(guī)則需要特殊的處理,概括如下:

            ?

            1.3.1 Variable Length Unsigned 29-bit Integer Encoding

            可變長度的無符號29位整數(shù)的編碼

            ?

            AMF 3 makes use of a special compact format for writing integers to reduce the number of bytes required for encoding.

            AMF3使用一種特別的壓縮格式來寫整數(shù),用于壓縮編碼的字節(jié)數(shù)量。

            As with a normal 32-bit integer, up to 4 bytes are required to hold the value however the high bit of the first 3 bytes are used as flags to determine whether the next byte is part of the integer.

            對于一個正常的32-bit的整數(shù),需要4個字節(jié)來存儲,然而前3個字節(jié)的最高位是用于標(biāo)識下一個字節(jié)是不是整數(shù)的一部分

            With up to 3 bits of the 32 bits being used as flags, only 29 significant bits remain for encoding an integer. This means the largest unsigned integer value that can be represented is 229 – 1

            在32-bit中多達(dá)3個bit是用來標(biāo)志的,所以對編碼的一個整數(shù)僅僅有29個bit有意義。這意味著最大的無符號的整數(shù)值是229-1。

            ?


            ?

            In ABNF syntax, the variable length unsigned 29-bit integer type is described as follows:

            在ABNF語法中, 可變長度的無符號的29位的整型數(shù)據(jù)類型描述如下:

            ?


            ?

            1.3.2 Strings and UTF-8

            AMF 0 and AMF 3 use (non-modified) UTF-8 to encode strings. UTF-8 is the abbreviation for 8-bit Unicode Transformation Format. UTF-8 strings are typically preceded with a byte-length header followed by a sequence of variable length (1 to 4 octets) encoded Unicode code-points.

            AMF0和AMF3使用UTF-8來編碼字符串(沒有變化的)。UTF-8是8-bit的Unicode Transformation Format(統(tǒng)一的傳輸格式)的縮寫。UTF-8字符串是典型的字節(jié)長度為頭,緊跟著編碼Unicode編碼點的可變長度(1到4個字節(jié))的字節(jié)序列。

            AMF 3 uses a slightly modified byte-length header; a detailed description is provided below and referred to throughout the document.

            AMF3使用一個輕微改變的字節(jié)長度頭;適用于整個文檔的具體描述如下。

            ?


            ?

            In ABNF syntax, [RFC3629] describes UTF-8 as follows:

            在ABNF句法,[RFC3629]描述UTF-8如下:

            ?


            ?

            For AMF 3 a string can be encoded as a string literal or a string reference.

            對于AMF3,一個字符串可以作為字面值或引用來編碼。

            A variable length unsigned 29-bit integer is used for the header and the first bit is flag that specifies which type of string is encoded.

            可變長度的無符號的29-bit的整數(shù)用于頭,并且第一個bit標(biāo)識字符串的編碼。

            If the flag is 0, a string literal is encoded and the remaining bits are used to encode the byte-length of the UTF-8 encoded String.

            標(biāo)識為0時,字符串是字面上編碼的,余下的位數(shù)是用來編碼UTF-8的編碼的字節(jié)的長度。

            If the flag is 1, then a string reference is encoded and the remaining bits are used to encode an index to the implicit string reference table.

            標(biāo)識為1時,是字符串引用的編碼,余下的位數(shù)是用來編碼直指隱含的字符串引用表的一個索引。

            ?


            (譯者注:標(biāo)識位的意義前后定義的不一樣)

            ?

            Note that this encoding imposes some theoretical limits on the use of Strings.

            注意:這個編碼增加了字符串使用上的理論上的限制。

            The number of unique Strings that can be sent by reference is limited to 228 - 1, and the byte-length of each UTF-8 encoded String is limited to 228 - 1 bytes (approx 256 MB).

            一個被引用發(fā)送的字符串的最大長度是:228-1,每一個UTF-8編碼的字符串長度是228-1字節(jié)(大概256MB)。

            ?

            2. Technical Summary 技術(shù)摘要

            2.1 Summary of improvements 改進(jìn)的摘要

            ?

            The following is a table of the improvements and changes in AMF 3:

            以下是AMF3的改進(jìn)和改變的目錄:

            ?

            ?

            ?

            Object traits can now be sent by reference

            對象的特性現(xiàn)在可以被引用發(fā)送

            Strings can now be sent by reference

            字符串可以被引用發(fā)送

            int/uint type support

            對int/uint類型的支持

            flash.utils.ByteArray type support, can also be sent by reference

            對flash.utils.ByteArray 類型的支持,也可以通過引用發(fā)送

            flash.utils.IExternalizable support

            對flash.utils.IExternalizable的支持。

            Variable length encoding scheme for integers to reduce data size

            旨在壓縮數(shù)據(jù)大小的可變長度的整數(shù)的編碼策略

            References are sent using variable length integer

            可變長度的整數(shù)的引用發(fā)送

            String UTF-8 length uses variable length integer

            UTF-8的字符串長度使用可變長度的整數(shù)

            Array count uses variable length integer

            數(shù)組的長度使用可變長度的整數(shù)

            A single Array type marker covers both strict and ECMA Arrays

            一個單獨的Array數(shù)組數(shù)據(jù)類型覆蓋了嚴(yán)格的和ECMA兩個數(shù)組

            Dates no longer send timezone information

            日期不再發(fā)送時區(qū)信息

            Dates can now be sent by reference

            日期可以通過引用發(fā)送

            XMLDocument UTF-8 length uses variable length integer

            XMLDocument的UTF-8的長度使用可變長度整數(shù)

            XMLDocument can now be sent by reference

            XMLDocument可以通過引用發(fā)送

            XML type support, can also be sent by reference

            XML也可以通過應(yīng)用發(fā)送

            XML UTF-8 length uses variable length integer

            ByteArray type length uses variable length integer

            Boolean true and false are now sent as one byte type markers

            Boolean類型使用一個字節(jié)標(biāo)識。

            Unsupported type marker has been removed

            不支持類型標(biāo)志被刪除了

            Reserved RecordSet and Movieclip type markers have been removed

            保留了RecordSet和Movieclip類型標(biāo)識被刪除了。

            ?

            2.2 Reference Tables

            In AMF 3, Strings, Complex Objects (which in AMF 3 are defined as anonymous Objects, typed Objects, Arrays, Dates, XMLDocument, XML, and ByteArrays) and an Object Type's Traits can now be sent by reference.

            在AMF3中,字符串,復(fù)雜對象(他是AMF3中定義的匿名對象,類型化的對象,數(shù)組,日期,xml文檔,xml, 字節(jié)數(shù)組)

            This means that instead of sending redundant information, these components of AMF can simply refer to an earlier occurrence of a component.

            這意味著不發(fā)送冗余信息,這些AMF組件可以簡單的參考先前的版本。

            This reference is an integer forming a zero-based index that is encoded in the component information, typically in the first number that appears after the relevant type marker (see the type definitions for Object, Array, Date, XMLDocument, XML and ByteArray below for exact details).

            這個引用從0開始索引的整數(shù),被編碼在組件信息中,典型地出現(xiàn)在相關(guān)的類型標(biāo)識(詳細(xì)情況查閱下面Object, Array, Date, XMLDocument, XML and ByteArray類型定義)之后第一個數(shù)字。

            These indexes form a virtual "table" of references that a deserializer and serializer must maintain when reading and writing AMF 3 formatted data.

            這些索引形式是一個引用的虛擬表,在讀寫AMF3格式的數(shù)據(jù)的時候必須有一個反序列化器和序列化其來維護(hù)這個表。

            ?

            Note that 3 separate reference tables are used for Strings, Complex Objects and

            Object Traits respectively.

            注意:不同的引用表被用于對應(yīng)的字符串,復(fù)雜對象和對象特性。

            ?

            3 AMF 3 Data Types

            3.1 Overview

            There are 13 types in AMF 3. A type marker is one byte in length and describes the type of encoded data that follows.

            有13個AMF3的類型。一個類型標(biāo)識占用一個字節(jié),描述跟著他的編碼的數(shù)據(jù)類型。

            ?


            ?

            The set of possible type markers are listed below (values are represented in hexadecimal format):

            所有可能的類型標(biāo)識羅列如下(值是用16進(jìn)制表示的):

            ?

            ?

            Type markers may be followed by the actual encoded type data, or if the marker represents a single possible value (such as null) then no further information needs to be encoded.

            典型的標(biāo)識后有真正的比啊類型數(shù)據(jù),或者如果標(biāo)識標(biāo)識一個單獨可能的值(如null),就沒有編碼的信息了。

            ?


            ?

            AMF 3 makes use of three reference tables for strings, objects and traits (the characteristics of objects that define a strong type such as the class name and public member names).

            AMF3使用三個引用表,分別用于字符串,對象和特性(一個強(qiáng)類型的對象特征有如類的名字和公共成員名字)

            These tables are considered implicit as they are not encoded as a unique entity in the format.

            這些表是隱含著的,因為他們不是作為一個在格式上唯一編碼的實體。

            Each type that can be sent by reference may instead be encoded using an index to the appropriate reference table.

            每一個可以被引用發(fā)送的實體,會使用合適的引用表中的一個索引來編碼。

            Strings can be sent by reference using an index to the string table.

            字符串能使用字符串引用表中的索引被發(fā)送。

            Object, Array, XML, XMLDocument, ByteArray, Date and instances of user defined Classes can be sent by reference using an index to the object table.

            對象,數(shù)組,XML,XMLDocument,ByteArray,Date 和 用法定義的類實例可以使用對象表的索引來進(jìn)行引用發(fā)送。

            Objects and instances of user defined Classes have trait information which can also be sent by reference using an index to the traits table.

            對象和自定義實例的特性信息也使用特性表中的索引來進(jìn)行引用發(fā)送。

            ?

            3.2 undefined Type 未定義類型

            The undefined type is represented by the undefined type marker. No further information is encoded for this value.

            未定義類型由未定義類型標(biāo)識來表示。對于這個值沒有其他的信息。

            ?


            ?

            Note that endpoints other than the AVM may not have the concept of undefined and may choose to represent undefined as null.

            注意:不是AVM的其他終端可能沒有未定義的概念,可能會選擇null來表示未定義的類型。

            ?

            3.3 null Type

            The null type is represented by the null type marker. No further information is encoded for this value.

            Null類型由null類型標(biāo)識來表示。對于這個值沒有其他的信息。

            ?


            ?

            3.4 false Type

            The false type is represented by the false type marker and is used to encode a Boolean value of false.

            False類型用false類型標(biāo)識來表示,并且用false的Boolean值來編碼。

            Note that in ActionScript 3.0 the concept of a primitive and Object form of Boolean does not exist. No further information is encoded for this value.

            注意:在AS3.0中,基本的Object形式的Boolean概念不復(fù)存在。對于這個值沒有其他的信息。

            ?


            ?

            3.5 true type

            The true type is represented by the true type marker and is used to encode a Boolean value of true. Note that in ActionScript 3.0 the concept of a primitive and Object form of Boolean does not exist. No further information is encoded for this value.

            (譯者:和false類似)

            ?


            ?

            3.6 integer type

            In AMF 3 integers are serialized using a variable length unsigned 29-bit integer.

            在AMF3中,整數(shù)是使用可變長度的無符號的29-bit整數(shù)來序列化。

            The ActionScript 3.0 integer types - a signed 'int' type and an unsigned 'uint' type - are also represented using 29-bits in AVM+.

            AS3.0的整數(shù)類型,int表示有符號的,uint標(biāo)識無符號的,在AVM+中也使用29-bit來表示。

            If the value of an unsigned integer (uint) is greater or equal to 229 or if the value of a signed integer (int) is greater than or equal to 228 then it will be represented by AVM+ as a double and thus serialized in using the AMF 3 double type.

            如果uint整數(shù)大于或等于229,int整數(shù)大于等于228,在AVM+中會用雙精度浮點數(shù)來表示,并用AMF3的雙精度浮點數(shù)來序列化他。

            ?


            ?

            3.7 double type

            The AMF 3 double type is encoded in the same manner as the AMF 0 Number type.

            AMF3的雙精度浮點型和AMF0的的雙精度浮點型的編碼是一樣的。

            This type is used to encode an ActionScript Number or an ActionScript int of value greater than or equal to 228 or an ActionScript uint of value greater than or equal to 229.

            The encoded value is always an 8 byte IEEE-754 double precision floating point value in network byte order (sign bit in low memory).

            編碼的值在網(wǎng)絡(luò)序列中總是一個8個字節(jié)的IEEE-754的雙精度浮點值(符號位在低位內(nèi)存)

            ?


            ?

            3.8 String type

            ActionScript String values are represented using a single string type in AMF 3 - the concept of string and long string types from AMF 0 is not used.

            AMF3中,AS的字符串的值用一個字符串類型來表示,AMF0中的字符串和長字符串的概念不使用了。

            Strings can be sent as a reference to a previously occurring String by using an index to the implicit string reference table.

            Strings are encoding using UTF-8 - however the header may either describe a string literal or a string reference.

            (譯者:以上都是之前翻譯了的)

            The empty String is never sent by reference.

            空的字符串不會被應(yīng)用發(fā)送

            ?


            ?

            3.9 XMLDocument type

            ActionScript 3.0 introduced a new XML type (see 3.13) however the legacy XMLDocument type is retained in the language as flash.xml.XMLDocument.

            雖然遺產(chǎn)類XMLDocument被保留了下了,AS3.0還是引進(jìn)了XML類型。

            Similar to AMF 0, the structure of an XMLDocument needs to be flattened into a string representation for serialization.

            和AMF0類似,XMLDocument的結(jié)構(gòu)需要轉(zhuǎn)換為字符串表示來序列化。

            As with other strings in AMF, the content is encoded in UTF-8.

            在AMF中,因為需要字符串,其內(nèi)容用UTF-8來編碼。

            ?

            XMLDocuments can be sent as a reference to a previously occurring XMLDocument instance by using an index to the implicit object reference table.

            對于當(dāng)前產(chǎn)生的XMLDocument實例,可以使用隱含的對象引用表的一個索引來進(jìn)行引用發(fā)送。


            ?

            Note that this encoding imposes some theoretical limits on the use of XMLDocument. The byte-length of each UTF-8 encoded XMLDocument instance is limited to 228 - 1 bytes (approx 256 MB).

            (譯者:以上都是之前翻譯了的)

            ?

            3.10 Date type

            In AMF 3 an ActionScript Date is serialized simply as the number of milliseconds elapsed since the epoch of midnight, 1st Jan 1970 in the UTC time zone.

            在AMF3中,AS日期簡單地序列化為一個從公元1970年1月1日零點,使用UTC時區(qū)的到現(xiàn)在的毫秒數(shù)。

            Local time zone information is not sent.

            本地時區(qū)信息不被發(fā)送。

            ?

            Dates can be sent as a reference to a previously occurring Date instance by using an index to the implicit object reference table.

            ?


            ?

            3.11 Array type

            ActionScript Arrays are described based on the nature of their indices, i.e. their type and how they are positioned in the Array.

            AS的數(shù)組是基于他的自然索引來描述的,例如:他們的類型和他們在數(shù)組中的位置

            The following table outlines the terms and their meaning:

            術(shù)語和他的意義列出如下:

            ?

            ?

            strict
            ?contains only ordinal (numeric) indices

            僅僅包含索引
            ?
            dense
            ?ordinal indices start at 0 and do not contain gaps between successive indices (that is, every index is defined from 0 for the length of the array)

            索引從0開始,不包含連續(xù)索引中的間隙(也就是說:每一個索引對于數(shù)組的長度來說都是從0開始定義的)
            ?
            sparse
            ?contains at least one gap between two indices

            在兩個索引中至少包含一個間隙
            ?
            associative
            ?contains at least one non-ordinal (string) index (sometimes referred to as an ECMA Array)

            至少包含一個非順序(字符串)索引(一些時候是ECMA數(shù)組)
            ?

            ?

            AMF considers Arrays in two parts, the dense portion and the associative portion.

            AMF把數(shù)組分為兩個部分,密集部分和關(guān)聯(lián)部分。

            The binary representation of the associative portion consists of name/value pairs (potentially none) terminated by an empty string.

            對于關(guān)聯(lián)部分的二進(jìn)制表示由以空字符串結(jié)束的名/值對(可能沒有)組成。

            The binary representation of the dense portion is the size of the dense portion (potentially zero) followed by an ordered list of values (potentially none).

            密集部分的二進(jìn)制表示是跟著順序的列表值(可能沒有)的密集部分的大小(可能是零)

            The order these are written in AMF is first the size of the dense portion, an empty string terminated list of name/value pairs, followed by size values.

            在AMF中寫入的順序是第一個密集部分的大小,空的字符串。

            ?


            ?

            3.12 Object type

            A single AMF 3 type handles ActionScript Objects and custom user classes. The term 'traits' is used to describe the defining characteristics of a class. In addition to 'anonymous' objects and 'typed' objects, ActionScript 3.0 introduces two further traits to describe how objects are serialized, namely 'dynamic' and 'externalizable'. The following table outlines the terms and their meanings:

            ?

            ?

            Anonymous
            ?an instance of the actual ActionScript Object type or an instance of a Class without a registered alias (that will be treated like an Object on deserialization)

            真實的AS對象實例或沒有別名注冊的類對象實例(反序列化時,他會像對象一樣處理)
            ?
            Typed
            ?an instance of a Class with a registered alias

            有別名注冊的類對象實例
            ?
            Dynamic
            ?an instance of a Class definition with the dynamic trait declared;

            使用動態(tài)特性聲明的類定義的實例

            public variable members can be added and removed from instances dynamically at runtime

            在運行時,可以動態(tài)的給實例添加和刪除公共成員變量。
            ?
            Externalizable
            ?an instance of a Class that implements flash.utils.IExternalizable and completely controls the serialization of its members (no property names are included in the trait information).

            實現(xiàn)了flash.utils.IExternalizable接口的類實例并且完全控制他的成員的序列化(在他們的特性信息中沒有屬性名)
            ?

            ?

            In addition to these characteristics, an object's traits information may also include a set of public variable and public read-writeable property names defined on a Class (i.e. public members that are not Functions).

            除了這些特性,對象特性信息也可能包括一組在類中定義公共變量和公共可讀寫的屬性名(例如:公共成員但不是函數(shù))。

            The order of the member names is important as the member values that follow the traits information will be in the exact same order.

            成員名字的順序是重要的,因為在特性信息中的成員值也是同樣的順序。

            These members are considered sealed members as they are explicitly defined by the type.

            這些成員是封裝的成員,因為他們是被類型顯示定義的。

            ?

            If the type is dynamic, a further section may be included after the sealed members that lists dynamic members as name / value pairs.

            如果類型是動態(tài)的,在封裝好的成員之后的部分會列出動態(tài)成員的名/值對

            One continues to read in dynamic members until a name that is the empty string is encountered.

            讀取動態(tài)成員指導(dǎo)名稱是空的字符串。

            ?

            Objects can be sent as a reference to a previously occurring Object by using an index to the implicit object reference table. Further more, trait information can also be sent as a reference to a previously occurring set of traits by using an index to the implicit traits reference table.

            ?

            ?

            U29O-ref
            ?U29
            ?; The first (low) bit is a flag

            低位第一位(bit)是一個標(biāo)志。

            ; (representing whether an instance

            ; follows 表示是否跟著個實例對象) with value 0 to imply that

            ; this is not an instance but a

            ; reference.

            為0時表示不是一個實例而是一個引用。

            The remaining 1 to 28

            ; significant bits are used to encode an

            ; object reference index (an integer).

            余下的1到28個有效的位是用來編碼一個對象引用的索引(一個整數(shù))

            ?
            ?
            U29O-traits-ref
            ?U29
            ?; The first (low) bit is a flag with

            ; value 1.

            第一個低位標(biāo)志位值為1

            The second bit is a flag

            ; (representing whether a trait

            ; reference follows) with value 0 to

            ; imply that this objects traits are

            ; being sent by reference.

            第二個位是個標(biāo)志位,0表示引用發(fā)送對象特性

            The remaining

            ; 1 to 27 significant bits are used to

            ; encode a trait reference index (an

            ; integer).

            余下的27位表示引用值(一個整數(shù))
            ?
            U29O-traits-ext
            ?U29
            ?; The first (low) bit is a flag with

            ; value 1. The second bit is a flag with

            ; value 1. The third bit is a flag with

            ; value 1.

            前三位標(biāo)志位都是1

            The remaining 1 to 26

            ; significant bits are not significant

            ; (the traits member count would always

            ; be 0).

            余下的26位無意義(特性成員的數(shù)量必須是0)
            ?
            U29O-traits
            ?U29
            ?; The first (low) bit is a flag with

            ; value 1. The second bit is a flag with

            ; value 1. The third bit is a flag with

            ; value 0.

            第一個標(biāo)志位為1,第二個標(biāo)志位為1,第三個標(biāo)志位為0。

            The fourth bit is a flag

            ; specifying whether the type is

            ; dynamic.

            第四個標(biāo)志位表示類型是不是動態(tài)的。

            A value of 0 implies not

            ; dynamic, a value of 1 implies dynamic.

            0表示不是動態(tài)的,1表示是動態(tài)的。

            ; Dynamic types may have a set of name

            ; value pairs for dynamic members after

            ; the sealed member section.

            在封裝好的成員之后,動態(tài)類型可能擁有一組動態(tài)成員的名/值對。

            The remaining 1 to 25 significant bits are

            ; used to encode the number of sealed

            ; traits member names that follow after

            ; the class name (an integer).

            余下的25位用來編碼封裝好的特性成員的名成的數(shù)量(一個整數(shù)),在他之后是類名。
            ?

            ?

            class-name
            ?UTF-8-vr
            ?; Note: use the empty string for

            ; anonymous classes.

            注意:對于匿名類,使用空的字符串。
            ?
            dynamic-member
            ?UTF-8-vr value-type
            ?; Another dynamic member follows

            ; until the string-type is the

            ; empty string.

            跟著的另一個動態(tài)成員,直到是個空的字符串類型。
            ?

            ?

            object-type
            ?object-marker (U29O-ref | (U29O-traits-ext class-name *(U8)) | U29O-traits-ref | (U29O-traits class-name *(UTF-8-vr))) *(value-type) *(dynamic-member)))
            ?

            ?

            Note that for U29O-traits-ext, after the class-name follows an indeterminable number of bytes as *(U8).

            注意對于U29O-traits-ext,類名之后跟著的*(U8)字節(jié)的不可決定的成員。

            This represents the completely custom serialization of "externalizable" types.

            這是表示的完全自定義序列化的外部化類型。

            The client and server have an agreement as to how to read in this information.

            客戶和服務(wù)端有一個協(xié)議讀取這部分信息。

            ?

            3.13 XML type

            ActionScript 3.0 introduces a new XML type that supports E4X syntax.

            AS3.0引進(jìn)了一個新的XML類型,支持E4X句法。

            For serialization purposes the XML type needs to be flattened into a string representation.

            XML類型轉(zhuǎn)換為字符串表示進(jìn)行序列化。

            As with other strings in AMF, the content is encoded using UTF-8.

            像AMF的其他字符串一樣,使用UTF-8進(jìn)行編碼。

            XML instances can be sent as a reference to a previously occurring XML instance by using an index to the implicit object reference table.

            ?


            ?

            Note that this encoding imposes some theoretical limits on the use of XML. The byte-length of each UTF-8 encoded XML instance is limited to 228 - 1 bytes (approx 256 MB).

            ?

            3.14 ByteArray type

            ActionScript 3.0 introduces a new type to hold an Array of bytes, namely ByteArray.

            AS3.0引進(jìn)了新的類型表示字節(jié)數(shù)組,即ByteArray。

            AMF 3 serializes this type using a variable length encoding 29-bit integer for the byte-length prefix followed by the raw bytes of the ByteArray.

            AMF3用可變長度的29-bit的整數(shù)編碼字節(jié)的長度作為前綴,其后跟著ByteArray的原始字節(jié)來序列化。

            ByteArray instances can be sent as a reference to a previously occurring ByteArray instance by using an index to the implicit object reference table.

            ?


            ?

            Note that this encoding imposes some theoretical limits on the use of ByteArray. The maximum byte-length of each ByteArray instance is limited to 228 - 1 bytes (approx 256 MB).

            ?

            4. Usages of AMF 3

            4.1 NetConnection and AMF 3

            In addition to serializing ActionScript types, AMF can be used in the asynchronous invocations of remote services.

            因為序列化的AS類型,AMF可用于異步的遠(yuǎn)程調(diào)用服務(wù)。

            ?

            A simple messaging structure is used to send a batch of requests to a remote endpoint.

            一個簡單的消息結(jié)構(gòu)是使用對遠(yuǎn)程端點發(fā)送一批請求。

            The format of this messaging structure is AMF 0 (See [AMF0].

            這個消息結(jié)構(gòu)的格式AMF0(參考[AMF0])

            A context header value or message body can switch to AMF 3 encoding using the special avmplus-object-marker type.

            使用一個特殊的avmplus-object-marker的類型可使一個上下文頭值或消息體切換到AMF3編碼。

            Similar to AMF 0, AMF 3 object reference tables, object trait reference tables and string reference tables must be reset each time a new context header or message is processed.

            和AMF0類似,AMF3對象引用表,對象特性引用表和字符串引用表必須在每次新的上下文頭或消息處理完時復(fù)位一次。

            ?

            4.1.1 NetConnection in ActionScript 3.0

            The qualified class name for NetConnection in ActionScript 3.0 is flash.net.NetConnection.

            NetConnection在AS3.0中的合適的類名是flash.net.NetConnection。

            This class continues to use a responder to handle result and status responses from a remote endpoint, however, a strongly typed Responder class is now required. The fully qualified class name is flash.net.Responder.

            這個類繼續(xù)使用一個響應(yīng)器處理從遠(yuǎn)程端點來的結(jié)果和狀態(tài),然而,現(xiàn)在需要強(qiáng)類型的響應(yīng)器類,類的全名是flash.net.Responder

            For events other than normal result and status responses NetConnection dispatches events for which the developer can add listeners.

            除了結(jié)果和狀態(tài)響應(yīng)的事件,也可以響應(yīng)開發(fā)真可能添加的監(jiān)聽器分派的事件。

            These events are outlined below:

            這些事件有:

            asyncError
            ?Dispatched when an exception is thrown asynchronously - i.e. from native asynchronous code.

            當(dāng)異步的拋出異常時分派,如從本地異步代碼
            ?
            ioError
            ?Dispatched when an input or output error occurs that causes a network operation to fail.

            引起網(wǎng)絡(luò)運行失敗的輸入/輸出錯誤發(fā)生時分派
            ?
            netStatus
            ?Dispatched when a NetConnection object is reporting its status or error condition.

            NetConnection對象報告他的狀態(tài)或錯誤的條件時分派
            ?
            securityError
            ?Dispatched if a call to NetConnection.call() attempts to connect to a server outside the caller's security sandbox.

            當(dāng)NetConnection試圖連接調(diào)用者的安全沙箱之外的服務(wù)器時發(fā)布
            ?

            ?

            To handle an AMF context header a suitable method needs to be available, matching the header name.

            為了處理AMF上下文頭,需要一個可用的合適的方法,并且和頭的名稱相匹配。

            NetConnection is now a sealed type so either it must be subclassed or an object with a suitable implementation needs to be set for the NetConnection client property.

            NetConnection 現(xiàn)在是一個封裝好的類型,因為他必須是某個子類或者實現(xiàn)合適的接口可以對他的客戶屬性做需要的設(shè)定。

            ?

            ?

            4.2 ByteArray, IDataInput and IDataOutput

            ActionScript 3.0 introduced a new type to support the manipulation of raw data in the form of an Array of bytes, namely flash.utils.ByteArray.

            為了支持字節(jié)數(shù)組形式的原始數(shù)據(jù)的操作,AS3.0引入了一個新的數(shù)據(jù)類型,即flash.utils.ByteArray。

            To assist with ActionScript Object serialization and copying, ByteArray implements flash.utils.IDataInput and flash.utils.IDataOutput.

            為了輔助AS對象的序列化和復(fù)制,ByteArray實現(xiàn)了flash.utils.IDataInput和flash.utils.IDataOutput兩個接口。

            These interfaces specify utility methods that help write common types to byte streams.

            這兩個接口定義了使得常用類型轉(zhuǎn)換為字節(jié)流的工具方法。

            Two methods of interest are IDataOutput.writeObject and IDataInput.readObject.

            常用的兩個方法是DataOutput.writeObject和IDataInput.readObject。

            These methods encode objects using AMF.

            這兩個方法使用AMF格式編碼實例對象。

            The version of AMF used to encode object data is controlled by the ByteArray.

            編碼實例對象的AMF版本是由ByteArray控制的。

            objectEncoding method, which can be set to either AMF 3 or AMF 0.

            objectEncoding方法,可以適當(dāng)是AMF3或者AMF0。

            An enumeration type, flash.net.ObjectEncoding, holds the constants for the versions of AMF - ObjectEncoding.AMF0 and ObjectEncoding.AMF3 respectively.

            一個枚舉的類型flash.net.ObjectEncoding,擁有AMF版本的常量,分別為ObjectEncoding.AMF0和ObjectEncoding.AMF3。

            Note that ByteArray.writeObject uses one version of AMF to encode the entire object. Unlike NetConnection, ByteArray does not start out in AMF 0 and switch to AMF 3 (with the objectEncoding property set to AMF 3).

            注意:ByteArray使用AMF的一個版本編碼整個對象。不像NetConnection,ByteArray不在AMF0中開始輸出并且切換到AMF3(通過設(shè)定objectEncoding屬性到AMF3)

            Also note that ByteArray uses a new set of implicit reference tables for objects, object traits and strings for each readObject and writeObject call.

            還有注意:ByteArray對每一個對象的讀寫調(diào)用都使用一組新的對象,對象特性和字符串引用表。

            ?

            5. Normative References 標(biāo)準(zhǔn)的參考文檔

            [AMF0]
            ?Adobe Systems Inc. "Action Message Format - AMF 0", June 2006.
            ?
            [RFC2234]
            ?D. Crocker., et. al. "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.
            ?
            [RFC3629]
            ?Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC 3629, November 2003.
            ?


            本文來自CSDN博客,轉(zhuǎn)載請標(biāo)明出處:http://blog.csdn.net/Thinkor2k8/archive/2008/11/14/3300570.aspx

            ?

            久久亚洲私人国产精品| 97久久综合精品久久久综合| 国产精品久久永久免费| 伊人久久大香线蕉亚洲五月天| 国产999精品久久久久久| 日本久久久精品中文字幕| 久久丫精品国产亚洲av不卡 | 久久精品国产亚洲一区二区| 亚洲AV日韩精品久久久久久久| 无码任你躁久久久久久久| 久久无码一区二区三区少妇 | 久久人妻少妇嫩草AV无码专区| 久久久久久精品免费免费自慰| 久久人做人爽一区二区三区| 久久99精品久久久大学生| 人妻少妇久久中文字幕一区二区| 久久水蜜桃亚洲av无码精品麻豆| 无码人妻久久一区二区三区免费丨 | 国内精品九九久久精品 | 99久久www免费人成精品| 国产亚洲精久久久久久无码AV| 久久成人18免费网站| 欧美成a人片免费看久久| 亚洲精品无码久久毛片| 97久久国产露脸精品国产| 国产V综合V亚洲欧美久久| 亚洲综合久久综合激情久久| 久久夜色撩人精品国产小说| 久久精品国产2020| 国产亚洲欧美成人久久片| 久久亚洲av无码精品浪潮| 97久久婷婷五月综合色d啪蜜芽| 99久久久国产精品免费无卡顿| 99久久精品免费观看国产| 久久久久久久综合狠狠综合| 色婷婷综合久久久久中文| 日韩精品国产自在久久现线拍 | 久久久综合九色合综国产| 久久WWW免费人成—看片| 亚洲av成人无码久久精品| 精品久久久久久无码免费|