1

The coding language is Java.
I have a ByteArray embedded in ActionScriptObject.(http://smartfoxserver.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

1
  • If you know that your byteArray is already an image: Why don't you just write the data into file stream on disk and set the proper extension for it? Commented Jul 2, 2010 at 13:13

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

thanks pal... the perfect answer... i figured that by myself.... still you deserve the bounty...
0

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

Regards.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.