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 itHave tried http://www.javafaq.nu/java-article236.html'>this method
It failed with thejava.io.NotSerializable Exception
Regards,
naveenjThe 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.
精彩评论