Expand my Community achievements bar.

SOLVED

ByteArray serialization

Avatar

Level 1
Using RemoteObject calls, I'm able to return a java byte[]
from a server method and it comes out just fine on the client as a
flash.utils.ByteArray object. But when I have a byte[] as a member
of an enclosing class, I'm getting null on the client for the
ByteArray. Example:




Java class

package org.xyz;



public class DimensionTest {

private byte[] _component = new byte[] {1,2,3,4,5,6};

}




AS class

package org.xyz

{

import flash.utils.ByteArray;



[RemoteClass(alias="org.xyz.DimensionTest")]

public class DimensionTest

{

public var _component:ByteArray;

}

}



When my server method returns a new DimensionTest, I get an
AS DimensionTest class on the client with a null _component.



Any idea what I'm doing wrong?



Brian

1 Accepted Solution

Avatar

Correct answer by
Level 1
from page 1371 in the developer's guide.



values found in public getter/setter method pairs and public
variables are passed to the client as properties on an Object.
Private properties, constants, static properties, and read-only
properties, and so on, are not serialized.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 1
from page 1371 in the developer's guide.



values found in public getter/setter method pairs and public
variables are passed to the client as properties on an Object.
Private properties, constants, static properties, and read-only
properties, and so on, are not serialized.

Avatar

Former Community Member
Does this explain your problem?



> from page 1371 in the developer's guide.

>

> values found in public getter/setter method pairs and
public

> variables are passed to the client as properties on an
Object. Private

> properties, constants, static properties, and read-only
properties,

> and so on, are not serialized.