开发者

How to Convert ActionScriptObject to ByteArray?

The coding language is Java.

I have a ByteArray embedded in ActionScriptObject.(http://sm开发者_Go百科artfoxserver.com/'>Smartfox Server)

I want to convert it into ByteArray.

The idea is to save it as an image.

This a sequel to the post --> Convert Byte Array from Action Script to Image in Java and save it

Have tried http://www.javafaq.nu/java-article236.html'>this method

It failed with the

java.io.NotSerializable Exception

Regards,

naveenj


The NotSerializableException is because the ActionScriptObject does not implement Serializable.

The ActionScriptObject does not support byte arrays. This is according to information found on the SmartFox Server forum. This probably means that when it creates the Java object that represents your ActionScript object, it does not copy the "arr" property at all!

To transfer the image data to the server you will have to use a network socket and write the data down the wire.

Reading the docs for Smartfox Server, there is a SocketLoader tutorial in chapter 8.17 which should allow you to transmit the image data to the server. http://www.smartfoxserver.com/docs/index.htm?http://www.smartfoxserver.com/docs/docPages/tutorials_pro/17_socketFileLoader/index.htm


Have you tried with JBoss Serialization? http://www.jboss.org/serialization

Regards.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜