Convert Object[] to SFSObject in Java

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Posts: 97
Joined: 27 Jan 2009, 21:34

Convert Object[] to SFSObject in Java

Postby dingo » 25 Jun 2012, 08:05


is there an a way to convert Object[] to an SFSArray on the Java server?
I'm trying to do something like:

Code: Select all

protected void CallMethodOnClient(String methodName, User recipient, Object...args)
       ISFSObject params = new SFSObject();
       ISFSArray arrgh = new SFSArray.newFrom?(args);
       params.putSFSArray("p", arrgh);

        send(methodName, params, recipient);

In Actionscript i can do this with:

Code: Select all

SFSArray.newFromArray(args, false);

Many thanks. :D
User avatar
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Convert Object[] to SFSObject in Java

Postby Lapo » 26 Jun 2012, 09:07

No, because an Object[] can contain all kind of classes that the SFSObject might not be able to serialize.
Additionally the SFSObject is a map-type collection where for each Object is retrieved via its String key. An Object[], on the contrary, has no keys, only indexes.
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DavinVicy, DerikFent, JerodSa and 18 guests