《AMF3协议中文版》由会员分享,可在线阅读,更多相关《AMF3协议中文版(15页珍藏版)》请在金锄头文库上搜索。
1、whatwecallhumannatureisactuallyhumanhabit.AdobeSystemsInc.AMF3SpecificationCategoryActioncriterialiationAActionMessageFormat-AMF3CopyrighNtoticeCopyrigh(tc)AdobeSystemsInc(.2002-2A0ll0R6ig).htsReserved.Abstract概览ActionMessageFormat(AMF)isacompacbtinaryformathtatisusedtoserializeActionScirptobjectgra
2、phsO.nceserializedanAMFencodedobjecgtraphmaybeusedtopersisatndretrievethepublicstateofanapplicatioancrosssessionsorallowtwoendpointtsocommunicatethroughtheexchangeofstronglytypedata.AMF(ActionMessageFormat)A(Actioncpt)(obegtrahs)AMF编个端点(AMFwasintroducedinFlashPlayer6in200an1dremainedunchangedwiththe
3、introductionofActionScirpt2.0inFlashPlayer7andwiththereleaseofFlashPlayer8.ThisversionofAMFisreferretodasAMF0(SeeAMF0I)nF.lashPlayer9,ActionScrip3t.0wasintroducedalongwithanewActionScirptVirtualMachine(AVM+)-thenewdatatypesandlanguagefeaturemsadepossiblebytheseimprovemenptsrompteAdMFtobeupdated.Give
4、tnheopportunittoyreleaseanewversionofAMF,severaolpitmizationswerealsomadetotheencodingformatotremoveredundantinformatiofnromserializedata.ThisspecicfationdefinethsisupdatedversionofAMF,namelyAMF3.AMFFlashlayerA.FlashlayerFlashPlayerAMFAMF(AMF。在)FlashPlyaerA3.A(AM)AMFAMFAMFAMFAMF3ableofContents目录(略)n
5、troductionuroseActionMessageFormat(AMF)isacompacbtinaryformathtatisusedtoserializeActionScirptobjectgraphsO.nceserializedanAMFencodedobjecgtraphmaybeusedtopersisatndretrievethepublicstateofanapplicatioancrosssessionsorallowtwoendpointtsocommunicatethroughtheexchangeostronglytyedata.()Thefirsvtersion
6、ofAMF,referretodasAMF0,supporstsendingcomplexobjectbsyreferencwehichhelpstoavoidsendingredundantinstancesinanobjecgtraph.AMFAMFocritrcularreferencewshileavoidingatlsoallowsendpointtsorestoreobjecretlationshipasndsuroblemsuchasinfiniterecursionduringserialization.AnewversionofAMF,referredtoasAMF3toco
7、incidewiththereleaseofActionScirpt3.0,improvesonAMF0bysendingobjectrtaitsandstringsbyreferenceinadditiontoobjecintstances.AMFAMF3A3.AMF3alsosupportssomenewdatatypesintroducedinActionScirpt3.0.AMF3A3.1.2NotationalConventions标记转换.AugmentedBNFBNFTypedefinitionsinthisspecificationuseAugmentedBackus-NauF
8、rorm(ABNF)syntaxRFC2234.(ABNF)FC3(译者注:BNFisaformalmeta-syntaxusedtoexpresscontext-freeGrammars.BNFisoneofthemostcommonlyusedmeta-syntacticnotationsforspecifyingthesyntaxofprogramminglanguages,commandsets,PDUs,andsimilarthings.However,pureBNFisratherlimited,sothetwovariationsEBNFandABNFhavebecomemore
9、popular.)Thereadershouldbefamiliarwiththisnotationbeforereadingthisdocument.3BasicRuleshroughoutthisdocumentbytesareassumedtobeoctets,or8-bits.Anunsignedbyte(8-bits,anoctet)Anunsigned1(network)byte-bitintegerorderinbigendianU32Anunsigned32-bitintegerinbigendian(network)byteorder中的无符号的占用32个二进制位DOUBLE
10、8byteIEEE-7floatingpointorder(signbitd4oubleprecisionvalueinnetworkinlowmemory).bytewhatwecallhumannatureisactuallyhumanhabit.whatwecallhumannatureisactuallyhumanhabit.EEE-MBAmegabyteorb7yt6es.whatwecallhumannatureisactuallyhumanhabit.whatwecallhumannatureisactuallyhumanhabit.Morecomplicateddatatype
11、rulesrequirespecialtreatmentwhichisoutlinedbelow.whatwecallhumannatureisactuallyhumanhabit.3.ariableengthnsigned-bitntegeEncodingAMF3makeusseofaspeciaclompacftormaftowrritingintegerstoreducethenumberofbytesrequiredfoerncoding.AMF3Aswithanormal32-biitnteger,upto4bytesarerequiredtoholdthevaluehowevetr
12、hehighbitothefirs3tbytesareusedasflagstodeterminewhetherthenextbyteisparotftheinteger.3-bit3Withupto3bitsofthe32bitsbeingusedasflagso,nly29significanbtitsremainfoerncodinganinteger.hismeansthelargestunsignedntegeraluehatcanbereresentdad3七中3bitbit003003-CELELLEELjO330900j-CSLELLEELjOj0000j-C30TLLEELj
13、0JOO:J08j-C30003ELL:jO:jOO3OO:j-CDOOOOOL(pex)gxcgE:zt:::uyxxxxxxxyxxxxxxxyxxxxxxxxxxxxxxxyxxxxxxxyxxxxxxx:jxxxxxxx7XXXXXXX:jxxxxxxx:jxxxxxxxnARNFsyntax,thevariablelengthunsigned29-biinttegertypeisdescribedasfollowsARFxgo-EE/X30-LE艸C-ELi:Zd-3=XE:C-ELxgo-EE/00-E二二己-二OO-jE.二二3-丁=x:jC-2L:=liCc-T1二m丨113-
14、31二二己一寸1.3.2StringsandUTF-8AMF0andAMF3use(non-modified)UTF-8toencodestrings.UTF-8istheabbreviatiofno8r-bitUnicodeTransformatiFoonrmat.UTF-8stringsaretypicallyprecedewdithabyte-lengthheaderfollowedbyasequencoefvariablelength(1to4octets)encodedUnicodecode-points.AMFAMF3F-F-七的nicoderansormationFormatF-
15、nicodeAMF3usesaslightlymodifiedbyte-lengthheader;adetaileddescripiotnisprovidebdelowandreferretodthroughoutthedocument.AMF3jOJCTJOOj-COCTjLtELjOJOOJ80j-CjOOjLtLLjOjOO:jO8:j-CjOOOOELjO300JOOj-COOOJC0212);T;7Cxxx;rxxxxxxycxxxxxx;rxxxxxx7T7r:xxxx7rxxxxxxrxxxxxx7fjxxxxx7rxxxxxxijXXXXXXX(pruarX)nARNFsyntax,RFC362de9scribesUTF-8asfollowsARFFC3F-:寸xgo-BE含ME二2IL8-3IL