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.
, , , .