AMF message structure?

The Adobe documentation for the AMF format does not seem to actually indicate the structure of the entire AMF message. It defines only the format of individual data types. I read this damn five times, and either I just don't completely understand what the actual AMF message should contain, or it does not exist. Does anyone know of any documentation about the actual structure of the entire message?

+5
source share
3 answers

The specification may be described as “concise”.

AMF coding uses bytes called "type markers". A type marker for an integer is a value of 4. Integer data immediately follows this tag and is 1-4 bytes. The length changes because the integer type is "compressed", so values ​​0-127 require only 1 byte, and larger values ​​require more bytes. This integer format is called the "U29" specification.

As an example, if we just passed the integer "5", these two bytes would be a valid AMF packet:
04 05

In applications found on the Internet, AMF data is sometimes preceded by a length encoded as the byte order of unsigned bytes. If you have observed such an application, you can see:
 00 00 00 02 04 05where 00 00 00 02indicates that the following AMF data is 2 bytes long.

, , :

   this.ui = "button_press";
   this.param = 5;

AMF :

0A -
2B - u29o-val: 2 , , ,
01 - -
05 - , : 2
75 69 - 'ui'
0B - , : 5
70 61 72 61 6D - 'param'
19 - , : 12
62 75 74 74 6F 6E 5F 70 72 65 73 73 - 'button_press'
04 - 05 - integer: 5
01 - ,

28 , : 00 00 00 1C, .

, AMF , , "deflate", zlib.

, , , .

+9

, AMF0 - 4

+1

You can also go through the wiki http://en.wikipedia.org/wiki/Action_Message_Format He has enough information.

Thanks, Rajesh.

0
source

All Articles