开发者

Java library to encode / decode AMF

I currently have a Java server that talks to a Flash client by passing JSO开发者_如何学JAVAN encoded data over a binary socket connection. Is there a way on either side to encode / decode packets as AMF instead of JSON? It seems to me that there should be some native support in Flash player for doing this? All the implementations I have found of AMF serialization seem to be embedded inside an application framework.

Simiarly so, does anyone know if it's possible to decode AMF packets independently of a connection implementation in Flash?


You can use OpenAMF's AMFDeserializer class,

http://www.openamf.com/javadocs/org/openamf/io/AMFDeserializer.html

You can also use the relevant classes in RED5 and BlazeDS.


AMF stands for Actionscript Messaging Format and is supported by the flash player itself out of the box. For the Java side, I'm sure there's some library already written. Red 5 is an open Flash Server written in Java that supports AMF, so you could check it out.

PS:

Looks like AMF serialization / deserialization is dealt with in this package (red 5 code): http://red5.googlecode.com/svn/java/server/tags/0_9rc1/src/org/red5/io/amf/. Not sure if there's a nice standalone API for this, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜