site : http://xinsync.xju.edu.cn/index.php/archives/1321
Flash Codecs - AMF, AMF3, RTMP, FLV
Data Type Mappings
| Flash/Flex | Java |
|---|---|
| Number | any of the Java numeric types |
| int/uint * | any of the non-floating point Java numeric types |
| String | String |
| Boolean | Boolean/boolean |
| Array | List |
| Object | org.red5.io.utils.ObjectMap |
| Date | java.util.Date |
| XML | org.w3c.dom.Document |
| ByteArray * | org.red5.io.amf3.ByteArray |
| IExternalizable * | org.red5.io.amf3.IExternalizable |
| ArrayCollection * | org.red5.compatibility.flex.messaging.io.ArrayCollection |
| ObjectProxy * | org.red5.compatibility.flex.messaging.io.ObjectProxy |
| Null | null |
| custom class ** | custom class |
Please note that Red5 performs automatic parameter conversion, e.g. if you pass a number to a method that takes a String as parameter, it is automatically converted.
| Java | Flash/Flex |
|---|---|
| any of the Java numeric types | Number |
| any of the non-floating point Java numeric types | int/uint * |
| String | String |
| boolean/Boolean | Boolean |
| List/Set | Array |
| Map | Array or Object, depends on the Map contents |
| any objects | Object |
| org.red5.io.utils.ObjectMap | Object |
| java.util.Date | Date |
| org.w3c.dom.Document | XML |
| org.red5.io.amf3.ByteArray | ByteArray * |
| org.red5.io.amf3.IExternalizable | IExternalizable * |
| org.red5.compatibility.flex.messaging.io.ArrayCollection | ArrayCollection * |
| org.red5.compatibility.flex.messaging.io.ObjectProxy | ObjectProxy * |
| null | Null |
| custom class | custom class ** |
* = Only available in Flash Player 9 or newer (AMF3)
** = You can map the class to serialize to in Red5 by adding “[RemoteClass(alias="package.to.RemoteClass")]” above your Flex class definition.
AMF与RTMP数据类型映射
本文详细介绍了Flash/Flex与Java间通过AMF和RTMP协议进行数据交换时不同类型之间的映射规则,包括基本类型如Number、String、Boolean等,复杂类型如Array、Object、Date及自定义类等。
3239

被折叠的 条评论
为什么被折叠?



